Uses of Interface
jdk.incubator.foreign.ResourceScope
Package
Description
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of ResourceScope in jdk.incubator.foreign
Modifier and TypeMethodDescriptionstatic ResourceScope
ResourceScope.globalScope()
Returns the global scope.static ResourceScope
ResourceScope.newConfinedScope()
Creates a new confined scope.static ResourceScope
ResourceScope.newConfinedScope
(Cleaner cleaner) Creates a new confined scope, managed by the provided cleaner instance.static ResourceScope
ResourceScope.newImplicitScope()
Creates a new shared scope, managed by a privateCleaner
instance.static ResourceScope
ResourceScope.newSharedScope()
Creates a new shared scope.static ResourceScope
ResourceScope.newSharedScope
(Cleaner cleaner) Creates a new shared scope, managed by the provided cleaner instance.MemorySegment.scope()
Returns the resource scope associated with this memory segment.NativeSymbol.scope()
Returns the resource scope associated with this symbol.VaList.scope()
Returns the resource scope associated with this variable argument list.Modifier and TypeMethodDescriptionstatic MemorySegment
MemorySegment.allocateNative
(long bytesSize, long alignmentBytes, ResourceScope scope) Creates a new 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 MemorySegment
MemorySegment.allocateNative
(long bytesSize, ResourceScope scope) Creates a new native memory segment that models a newly allocated block of off-heap memory with given size (in bytes) and resource scope.static MemorySegment
MemorySegment.allocateNative
(MemoryLayout layout, ResourceScope scope) Creates a new native memory segment that models a newly allocated block of off-heap memory with given layout and resource scope.void
ResourceScope.keepAlive
(ResourceScope target) Creates a temporal dependency between this scope and the target scope.static VaList
VaList.make
(Consumer<VaList.Builder> actions, ResourceScope scope) Constructs a new variable argument list using a builder (seeVaList.Builder
), with a given resource scope.static MemorySegment
MemorySegment.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 SegmentAllocator
SegmentAllocator.nativeAllocator
(ResourceScope scope) Returns a native allocator, associated with the provided scope.static SegmentAllocator
SegmentAllocator.newNativeArena
(long arenaSize, long blockSize, ResourceScope scope) Returns a native arena-based allocator, associated with the provided scope, with given arena size and block size.static SegmentAllocator
SegmentAllocator.newNativeArena
(long arenaSize, ResourceScope scope) Returns a native unbounded arena-based allocator, with block size set to the specified arena size, associated with the provided scope, with given arena size.static SegmentAllocator
SegmentAllocator.newNativeArena
(ResourceScope scope) Returns a native unbounded arena-based allocator, with predefined block size and maximum arena size, associated with the provided scope.static MemorySegment
MemorySegment.ofAddress
(MemoryAddress address, long bytesSize, ResourceScope scope) Creates a new native memory segment with given size and resource scope, and whose base address is the given address.static NativeSymbol
NativeSymbol.ofAddress
(String name, MemoryAddress address, ResourceScope scope) Creates a new symbol from given name, address and scope.static VaList
VaList.ofAddress
(MemoryAddress address, ResourceScope scope) Constructs a new variable argument list from a memory address pointing to an existing variable argument list, with given 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.