Uses of Interface
Classes to support low-level and efficient foreign memory/function access, directly from Java.
Uses of SegmentAllocator in jdk.incubator.foreignModifier and TypeMethodDescriptionReturns a native arena-based allocator which allocates a single memory segment, of given size (using malloc), and then responds to allocation request by returning different slices of that same segment (until no further allocation is possible).Returns a native unbounded arena-based allocator.Returns a native allocator which responds to allocation requests by allocating new segments bound by the given resource scope, using the
MemorySegment.allocateNative(long, long, ResourceScope)factory.Returns a segment allocator which responds to allocation requests by recycling a single segment; that is, each new allocation request will return a new slice starting at the segment offset
0(alignment constraints are ignored by this allocator).Modifier and TypeMethodDescriptionCLinker.
(Addressable symbol, SegmentAllocator allocator, MethodType type, FunctionDescriptor function)Obtain a foreign method handle, with the given type and featuring the given function descriptor, which can be used to call a target foreign function at the given address.
static MemorySegmentConverts a Java string into a UTF-8 encoded, null-terminated C string, storing the result into a native memory segment allocated using the provided allocator.Reads the next value as a
MemorySegment, and advances this va list's position.