public interface CommittedMemoryProvider
| Modifier and Type | Interface and Description |
|---|---|
static class |
CommittedMemoryProvider.Access |
| Modifier and Type | Field and Description |
|---|---|
static org.graalvm.word.UnsignedWord |
UNALIGNED
Value for alignment parameters that indicates that no specific alignment is required (other
than the granularity usually).
|
| Modifier and Type | Method and Description |
|---|---|
default void |
afterGarbageCollection()
Called by the garbage collector after a collection has ended, as an opportunity to perform
lazy operations, sanity checks or clean-ups.
|
default org.graalvm.word.Pointer |
allocate(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment,
boolean executable)
Allocate a block of committed memory.
|
org.graalvm.word.Pointer |
allocateAlignedChunk(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment) |
org.graalvm.word.Pointer |
allocateExecutableMemory(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment) |
org.graalvm.word.Pointer |
allocateUnalignedChunk(org.graalvm.word.UnsignedWord nbytes) |
boolean |
areUnalignedChunksZeroed()
This method returns
true if the memory returned by CommittedMemoryProvider.allocateUnalignedChunk(org.graalvm.word.UnsignedWord) is
guaranteed to be zeroed. |
default void |
beforeGarbageCollection()
Called by the garbage collector before a collection is started, as an opportunity to perform
lazy operations, sanity checks or clean-ups.
|
default boolean |
free(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment,
boolean executable)
Release a block of committed memory that was allocated with
CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean), requiring the
exact same parameter values that were originally passed to CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean). |
void |
freeAlignedChunk(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment) |
void |
freeExecutableMemory(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment) |
void |
freeUnalignedChunk(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes) |
static CommittedMemoryProvider |
get() |
default org.graalvm.word.UnsignedWord |
getGranularity()
Returns the granularity of committed memory management, which is typically the same as that
of virtual memory management.
|
boolean |
guaranteesHeapPreferredAddressSpaceAlignment()
Returns whether this provider will always guarantee a heap address space alignment of
Heap.getPreferredAddressSpaceAlignment() at image runtime, which may also depend on
ImageHeapProvider.guaranteesHeapPreferredAddressSpaceAlignment(). |
int |
initialize(org.graalvm.nativeimage.c.type.WordPointer isolatePointer,
CEntryPointCreateIsolateParameters parameters)
Performs initializations for the current isolate, before any other methods of this
interface may be called.
|
boolean |
protect(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
EnumSet<CommittedMemoryProvider.Access> access)
Change access permissions for a block of committed memory that was allocated with
CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean). |
int |
tearDown()
Tear down for the current isolate.
|
static final org.graalvm.word.UnsignedWord UNALIGNED
static CommittedMemoryProvider get()
boolean guaranteesHeapPreferredAddressSpaceAlignment()
Heap.getPreferredAddressSpaceAlignment() at image runtime, which may also depend on
ImageHeapProvider.guaranteesHeapPreferredAddressSpaceAlignment().int initialize(org.graalvm.nativeimage.c.type.WordPointer isolatePointer,
CEntryPointCreateIsolateParameters parameters)
int tearDown()
default org.graalvm.word.UnsignedWord getGranularity()
default org.graalvm.word.Pointer allocate(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment,
boolean executable)
nbytes - The number of bytes to allocate, which is rounded up to the next multiple of
the granularity if required.alignment - The required alignment of the block start, or CommittedMemoryProvider.UNALIGNED.executable - Whether the block must be executable.WordFactory.nullPointer() in case of an
error.org.graalvm.word.Pointer allocateAlignedChunk(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment)
org.graalvm.word.Pointer allocateUnalignedChunk(org.graalvm.word.UnsignedWord nbytes)
org.graalvm.word.Pointer allocateExecutableMemory(org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment)
boolean areUnalignedChunksZeroed()
true if the memory returned by CommittedMemoryProvider.allocateUnalignedChunk(org.graalvm.word.UnsignedWord) is
guaranteed to be zeroed.default boolean free(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment,
boolean executable)
CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean), requiring the
exact same parameter values that were originally passed to CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean).start - The start of the memory block, as returned by CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean).nbytes - The originally requested size in bytes.alignment - The originally requested alignment.executable - Whether the block was requested to be executable.void freeAlignedChunk(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment)
void freeUnalignedChunk(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes)
void freeExecutableMemory(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
org.graalvm.word.UnsignedWord alignment)
default void beforeGarbageCollection()
default void afterGarbageCollection()
boolean protect(org.graalvm.word.PointerBase start,
org.graalvm.word.UnsignedWord nbytes,
EnumSet<CommittedMemoryProvider.Access> access)
CommittedMemoryProvider.allocate(org.graalvm.word.UnsignedWord, org.graalvm.word.UnsignedWord, boolean).start - The start of the address range to be protected, which must be a multiple of the
granularity.nbytes - The size in bytes of the address range to be protected, which will be rounded
up to a multiple of the granularity.access - The modes in which the memory is permitted to be accessed, see CommittedMemoryProvider.Access.