< prev index next >

src/java.base/share/classes/java/lang/foreign/AddressLayout.java

Print this page
@@ -24,11 +24,10 @@
   */
  
  package java.lang.foreign;
  
  import jdk.internal.foreign.layout.ValueLayouts;
- import jdk.internal.javac.PreviewFeature;
  import jdk.internal.reflect.CallerSensitive;
  
  import java.lang.foreign.Linker.Option;
  import java.lang.invoke.MethodHandle;
  import java.nio.ByteOrder;

@@ -48,15 +47,17 @@
   *     memory segment, e.g. using {@link MemorySegment#getAtIndex(AddressLayout, long)};</li>
   *     <li>When creating a downcall method handle, using {@link Linker#downcallHandle(FunctionDescriptor, Option...)};
   *     <li>When creating an upcall stub, using {@link Linker#upcallStub(MethodHandle, FunctionDescriptor, Arena, Option...)}.
   * </ul>
   *
+  * @implSpec
+  * This class is immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
+  *
   * @see #ADDRESS
   * @see #ADDRESS_UNALIGNED
-  * @since 19
+  * @since 22
   */
- @PreviewFeature(feature = PreviewFeature.Feature.FOREIGN)
  public sealed interface AddressLayout extends ValueLayout permits ValueLayouts.OfAddressImpl {
  
      /**
       * {@inheritDoc}
       */

@@ -92,11 +93,11 @@
       * segments with maximal size (e.g. {@linkplain Long#MAX_VALUE}). This can be done by using a target sequence
       * layout with unspecified size, as follows:
       * {@snippet lang = java:
       * AddressLayout addressLayout   = ...
       * AddressLayout unboundedLayout = addressLayout.withTargetLayout(
-      *         MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE));
+      *         MemoryLayout.sequenceLayout(Long.MAX_VALUE, ValueLayout.JAVA_BYTE));
       *}
       * <p>
       * This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
       * Restricted methods are unsafe, and, if used incorrectly, their use might crash
       * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on
< prev index next >