Uses of Interface
jdk.incubator.foreign.MemoryAddress
Package
Description
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of MemoryAddress in jdk.incubator.foreign
Modifier and TypeFieldDescriptionstatic final MemoryAddress
MemoryAddress.NULL
The native memory address instance modelling theNULL
address, associated with the global resource scope.Modifier and TypeMethodDescriptionMemoryAddress.addOffset
(long offset) Creates a new memory address with given offset (in bytes), which might be negative, from current one.Addressable.address()
Map this object into aMemoryAddress
instance.CLinker.VaList.address()
Returns the memory address of the Cva_list
associated with this instance.default MemoryAddress
MemoryAddress.address()
MemorySegment.address()
The base memory address associated with this memory segment.static MemoryAddress
CLinker.allocateMemory
(long size) Allocates memory of given size using malloc.static MemoryAddress
MemoryAccess.getAddress
(MemorySegment segment) Reads a memory address from given segment, with byte order set toByteOrder.nativeOrder()
.static MemoryAddress
MemoryAccess.getAddressAtIndex
(MemorySegment segment, long index) Reads a memory address from given segment and element index, with byte order set toByteOrder.nativeOrder()
.static MemoryAddress
MemoryAccess.getAddressAtOffset
(MemorySegment segment, long offset) Reads a memory address from given segment and offset, with byte order set toByteOrder.nativeOrder()
.static MemoryAddress
MemoryAddress.ofLong
(long value) Obtain a native memory address instance from given long address.CLinker.upcallStub
(MethodHandle target, FunctionDescriptor function, ResourceScope scope) Allocates a native stub with given scope which can be passed to other foreign functions (as a function pointer); calling such a function pointer from native code will result in the execution of the provided method handle.CLinker.VaList.vargAsAddress
(MemoryLayout layout) Reads the next value as aMemoryAddress
and advances this va list's position.Modifier and TypeMethodDescriptionLooks up a symbol with given name in this lookup.Modifier and TypeMethodDescriptiondefault MemorySegment
MemorySegment.asSlice
(MemoryAddress newBase) Obtains a new memory segment view whose base address is the given address, and whose new size is computed by subtracting the address offset relative to this segment (seesegmentOffset(MemorySegment)
) from this segment size.default MemorySegment
MemorySegment.asSlice
(MemoryAddress newBase, long newSize) Obtains a new memory segment view whose base address is the given address, and whose new size is specified by the given argument.static void
CLinker.freeMemory
(MemoryAddress addr) Frees the memory pointed by the given memory address.static CLinker.VaList
CLinker.VaList.ofAddress
(MemoryAddress address) Constructs a newVaList
instance out of a memory address pointing to an existing Cva_list
, backed by the global resource scope.static CLinker.VaList
CLinker.VaList.ofAddress
(MemoryAddress address, ResourceScope scope) Constructs a newVaList
instance out of a memory address pointing to an existing Cva_list
, with given resource scope.static String
CLinker.toJavaString
(MemoryAddress addr) Converts a UTF-8 encoded, null-terminated C string stored at given address into a Java string.