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 MemoryAddress
MemoryAddress.NULL
The off-heap memory address instance modelling theNULL
address.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.LibraryLookup.Symbol.address()
The memory address of this lookup symbol.default MemoryAddress
MemoryAddress.address()
MemorySegment.address()
The base memory address associated with this memory segment.static MemoryAddress
CLinker.allocateMemoryRestricted(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 an off-heap memory address instance from given long address.CLinker.VaList.vargAsAddress(MemoryLayout layout)
Reads the next value as aMemoryAddress
and advances this va list's position.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.freeMemoryRestricted(MemoryAddress addr)
Frees the memory pointed by the given memory address.static CLinker.VaList
CLinker.VaList.ofAddressRestricted(MemoryAddress address)
Constructs a newVaList
instance out of a memory address pointing to an existing Cva_list
.static String
CLinker.toJavaStringRestricted(MemoryAddress addr)
Converts a null-terminated C string stored at given address into a Java string, using the platform's default charset.static String
CLinker.toJavaStringRestricted(MemoryAddress addr, Charset charset)
Converts a null-terminated C string stored at given address into a Java string, using the givencharset
.