Uses of Interface
jdk.incubator.foreign.ResourceScope
Packages that use ResourceScope
Package
Description
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of ResourceScope in jdk.incubator.foreign
Methods in jdk.incubator.foreign that return ResourceScopeModifier and TypeMethodDescriptionstatic ResourceScopeResourceScope.globalScope()Returns an implicit scope which is assumed to be always alive.static ResourceScopeResourceScope.newConfinedScope()Create a new confined scope.static ResourceScopeResourceScope.newConfinedScope(Cleaner cleaner) Create a new confined scope managed by aCleaner.static ResourceScopeResourceScope.newImplicitScope()Create a new implicit scope.static ResourceScopeResourceScope.newSharedScope()Create a new shared scope.static ResourceScopeResourceScope.newSharedScope(Cleaner cleaner) Create a new shared scope managed by aCleaner.CLinker.VaList.scope()Returns the resource scope associated with this instance.MemoryAddress.scope()Returns the resource scope associated with this memory address.MemorySegment.scope()Returns the resource scope associated with this memory segment.ResourceScope.Handle.scope()Returns the resource scope associated with this handle.Methods in jdk.incubator.foreign with parameters of type ResourceScopeModifier and TypeMethodDescriptionstatic MemorySegmentMemorySegment.allocateNative(long bytesSize, long alignmentBytes, ResourceScope scope) Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given size (in bytes), alignment constraint (in bytes) and resource scope.static MemorySegmentMemorySegment.allocateNative(long bytesSize, ResourceScope scope) Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given size (in bytes) and resource scope.static MemorySegmentMemorySegment.allocateNative(MemoryLayout layout, ResourceScope scope) Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given layout and resource scope.static SegmentAllocatorSegmentAllocator.arenaAllocator(long size, ResourceScope scope) Returns 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).static SegmentAllocatorSegmentAllocator.arenaAllocator(ResourceScope scope) Returns a native unbounded arena-based allocator.MemoryAddress.asSegment(long bytesSize, Runnable cleanupAction, ResourceScope scope) Returns a new native memory segment with given size and resource scope (replacing the scope already associated with this address), and whose base address is this address.MemoryAddress.asSegment(long bytesSize, ResourceScope scope) Returns a new native memory segment with given size and resource scope (replacing the scope already associated with this address), and whose base address is this address.static CLinker.VaListCLinker.VaList.make(Consumer<CLinker.VaList.Builder> actions, ResourceScope scope) Constructs a newVaListusing a builder (seeCLinker.VaList.Builder), associated with a given resource scope.static MemorySegmentMemorySegment.mapFile(Path path, long bytesOffset, long bytesSize, FileChannel.MapMode mapMode, ResourceScope scope) Creates a new mapped memory segment that models a memory-mapped region of a file from a given path.static CLinker.VaListCLinker.VaList.ofAddress(MemoryAddress address, ResourceScope scope) Constructs a newVaListinstance out of a memory address pointing to an existing Cva_list, with given resource scope.static SegmentAllocatorSegmentAllocator.ofScope(ResourceScope scope) Returns a native allocator which responds to allocation requests by allocating new segments bound by the given resource scope, using theMemorySegment.allocateNative(long, long, ResourceScope)factory.static MemorySegmentCLinker.toCString(String str, ResourceScope scope) Converts a Java string into a UTF-8 encoded, null-terminated C string, storing the result into a native memory segment associated with the provided resource scope.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.vargAsSegment(MemoryLayout layout, ResourceScope scope) Reads the next value as aMemorySegment, and advances this va list's position.