2727package java .lang .foreign ;
2828
2929import java .io .UncheckedIOException ;
30+ import java .lang .ref .Cleaner ;
3031import java .lang .reflect .Array ;
3132import java .lang .invoke .MethodHandles ;
3233import java .nio .Buffer ;
@@ -1118,7 +1119,7 @@ static MemorySegment ofAddress(long address, long byteSize, MemorySession sessio
11181119 * <p>
11191120 * Clients are responsible for ensuring that the memory session associated with the returned segment is
11201121 * closed when segments are no longer in use. Failure to do so will result in off-heap memory leaks. As an
1121- * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a Cleaner
1122+ * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a {@link Cleaner}
11221123 * (such as {@linkplain MemorySession#openImplicit()}) can be used, allowing the returned segment to be
11231124 * automatically released some unspecified time after the session is no longer referenced.
11241125 * <p>
@@ -1137,8 +1138,7 @@ static MemorySegment ofAddress(long address, long byteSize, MemorySession sessio
11371138 * @param session the session to which the returned segment is associated.
11381139 * @return a new native segment.
11391140 * @throws IllegalStateException if the {@code session} is not {@linkplain MemorySession#isAlive() alive}.
1140- * @throws WrongThreadException if this method is invoked by a thread other than the
1141- * {@linkplain MemorySession#ownerThread() owner thread} (if any).
1141+ * @throws WrongThreadException if this method is called from a thread other than the thread owning {@code session}.
11421142 * @see MemorySession#allocate(MemoryLayout)
11431143 */
11441144 static MemorySegment allocateNative (MemoryLayout layout , MemorySession session ) {
@@ -1151,7 +1151,7 @@ static MemorySegment allocateNative(MemoryLayout layout, MemorySession session)
11511151 * <p>
11521152 * Clients are responsible for ensuring that the memory session associated with the returned segment is
11531153 * closed when segments are no longer in use. Failure to do so will result in off-heap memory leaks. As an
1154- * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a Cleaner
1154+ * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a {@link Cleaner}
11551155 * (such as {@linkplain MemorySession#openImplicit()}) can be used, allowing the returned segment to be
11561156 * automatically released some unspecified time after the session is no longer referenced.
11571157 * <p>
@@ -1173,8 +1173,7 @@ static MemorySegment allocateNative(MemoryLayout layout, MemorySession session)
11731173 * @return a new native memory segment.
11741174 * @throws IllegalArgumentException if {@code byteSize < 0}.
11751175 * @throws IllegalStateException if the {@code session} is not {@linkplain MemorySession#isAlive() alive}.
1176- * @throws WrongThreadException if this method is invoked by a thread other than the
1177- * {@linkplain MemorySession#ownerThread() owner thread} (if any).
1176+ * @throws WrongThreadException if this method is called from a thread other than the thread owning {@code session}.
11781177 * @see ByteBuffer#allocateDirect(int)
11791178 * @see MemorySession#allocate(long)
11801179 */
@@ -1188,7 +1187,7 @@ static MemorySegment allocateNative(long byteSize, MemorySession session) {
11881187 * <p>
11891188 * Clients are responsible for ensuring that the memory session associated with the returned segment is
11901189 * closed when segments are no longer in use. Failure to do so will result in off-heap memory leaks. As an
1191- * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a Cleaner
1190+ * alternative to explicitly invoke {@link MemorySession#close()}, sessions backed with a {@link Cleaner}
11921191 * (such as {@linkplain MemorySession#openImplicit()}) can be used, allowing the returned segment to be
11931192 * automatically released some unspecified time after the session is no longer referenced.
11941193 * <p>
@@ -1214,8 +1213,7 @@ static MemorySegment allocateNative(long byteSize, MemorySession session) {
12141213 * @throws IllegalArgumentException if {@code byteSize < 0}, {@code byteAlignment <= 0}, or if {@code byteAlignment}
12151214 * is not a power of 2.
12161215 * @throws IllegalStateException if the {@code session} is not {@linkplain MemorySession#isAlive() alive}.
1217- * @throws WrongThreadException if this method is invoked by a thread other than the
1218- * {@linkplain MemorySession#ownerThread() owner thread} (if any).
1216+ * @throws WrongThreadException if this method is called from a thread other than the thread owning {@code session}.
12191217 * @see MemorySession#allocate(long, long)
12201218 */
12211219 static MemorySegment allocateNative (long byteSize , long byteAlignment , MemorySession session ) {
0 commit comments