Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mcimadamore committed Oct 13, 2023
1 parent a9de77c commit 81e6560
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/foreign/Arena.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* <p>
* The simplest arena is the {@linkplain Arena#global() global arena}. The global arena
* features an <em>unbounded lifetime</em>. The scope of the global arena is the global scope.
* As such, native segments allocated with the global arena are associated are always accessible and their backing regions
* As such, native segments allocated with the global arena are always accessible and their backing regions
* of memory are never deallocated.
* Moreover, memory segments allocated with the global arena can be {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} from any thread.
* {@snippet lang = java:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ default MethodHandle byteOffsetHandle(PathElement... elements) {
* </ul>
* <p>
* If the selected layout is an {@linkplain AddressLayout address layout}, calling {@link VarHandle#get(Object...)}
* on the returned var handle will return a new memory segment. The segment is associated with a scope that is
* always alive. Moreover, the size of the segment depends on whether the address layout has a
* on the returned var handle will return a new memory segment. The segment is associated with the global scope.
* Moreover, the size of the segment depends on whether the address layout has a
* {@linkplain AddressLayout#targetLayout() target layout}. More specifically:
* <ul>
* <li>If the address layout has a target layout {@code T}, then the size of the returned segment
Expand All @@ -481,7 +481,7 @@ default MethodHandle byteOffsetHandle(PathElement... elements) {
* {@snippet lang = "java":
* VarHandle baseHandle = this.varHandle(P);
* MemoryLayout target = ((AddressLayout)this.select(P)).targetLayout().get();
* VarHandle targetHandle = target.varHandle(P');
* VarHandle targetHandle = target.varHandle(P);
* targetHandle = MethodHandles.insertCoordinates(targetHandle, 1, 0L); // always access nested targets at offset 0
* targetHandle = MethodHandles.collectCoordinates(targetHandle, 0,
* baseHandle.toMethodHandle(VarHandle.AccessMode.GET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ static long mismatch(MemorySegment srcSegment, long srcFromOffset, long srcToOff
/**
* A scope models the <em>lifetime</em> of all the memory segments associated with it. That is, a memory segment
* cannot be accessed if its associated scope is not {@linkplain #isAlive() alive}. Scope instances can be compared
* for equality. That is, two scopes are considered {@linkplain #equals(Object)} if they denote the same lifetime.
* for equality. That is, two scopes are considered {@linkplain #equals(Object) equal} if they denote the same lifetime.
* <p>
* The lifetime of a memory segment can be either <em>unbounded</em> or <em>bounded</em>. An unbounded lifetime
* is modelled with the <em>global scope</em>. The global scope is always {@link #isAlive() alive}. As such, a segment
Expand Down

0 comments on commit 81e6560

Please sign in to comment.