< prev index next >

src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java

Print this page
*** 25,18 ***
  
  package jdk.incubator.foreign;
  
  /**
   * Represents a type which is <em>addressable</em>. An addressable type is one which can be projected down to
!  * a memory address instance (see {@link #address()}). Examples of addressable types are {@link MemorySegment},
!  * {@link MemoryAddress} and {@link CLinker.VaList}.
   *
   * @implSpec
   * Implementations of this interface are <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
   */
! public interface Addressable {
      /**
!      * Map this object into a {@link MemoryAddress} instance.
!      * @return the {@link MemoryAddress} instance associated with this object.
       */
      MemoryAddress address();
  }
--- 25,23 ---
  
  package jdk.incubator.foreign;
  
  /**
   * Represents a type which is <em>addressable</em>. An addressable type is one which can be projected down to
!  * a {@linkplain #address() memory address}. Examples of addressable types are {@link MemorySegment},
!  * {@link MemoryAddress}, {@link VaList} and {@link NativeSymbol}.
+  * <p>
+  * The {@link Addressable} type is used by the {@link CLinker C linker} to model the types of
+  * {@link CLinker#downcallHandle(FunctionDescriptor) downcall handle} parameters that must be passed <em>by reference</em>
+  * (e.g. memory addresses, va lists and upcall stubs).
   *
   * @implSpec
   * Implementations of this interface are <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
   */
! public sealed interface Addressable permits MemorySegment, MemoryAddress, NativeSymbol, VaList {
+ 
      /**
!      * Returns the memory address associated with this addressable.
!      * @return The memory address associated with this addressable.
       */
      MemoryAddress address();
  }
< prev index next >