mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8338489: Typo in MemorySegment doc
Reviewed-by: rriggs, mcimadamore, iris
This commit is contained in:
parent
44d3a68d8a
commit
2e96f159aa
1 changed files with 1 additions and 1 deletions
|
@ -475,7 +475,7 @@ import jdk.internal.vm.annotation.ForceInline;
|
||||||
* MemorySegment ptr = null;
|
* MemorySegment ptr = null;
|
||||||
* try (Arena arena = Arena.ofConfined()) {
|
* try (Arena arena = Arena.ofConfined()) {
|
||||||
* MemorySegment z = segment.get(ValueLayout.ADDRESS, ...); // size = 0, scope = always alive
|
* MemorySegment z = segment.get(ValueLayout.ADDRESS, ...); // size = 0, scope = always alive
|
||||||
* ptr = z.reinterpret(16, arena, null); // size = 4, scope = arena.scope()
|
* ptr = z.reinterpret(16, arena, null); // size = 16, scope = arena.scope()
|
||||||
* int x = ptr.getAtIndex(ValueLayout.JAVA_INT, 3); // ok
|
* int x = ptr.getAtIndex(ValueLayout.JAVA_INT, 3); // ok
|
||||||
* }
|
* }
|
||||||
* int x = ptr.getAtIndex(ValueLayout.JAVA_INT, 3); // throws IllegalStateException
|
* int x = ptr.getAtIndex(ValueLayout.JAVA_INT, 3); // throws IllegalStateException
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue