public final class ThreadLocalAllocation extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ThreadLocalAllocation.Descriptor |
static class |
ThreadLocalAllocation.TestingBackdoor
Expose some private methods for white-box testing.
|
Modifier and Type | Field and Description |
---|---|
static org.graalvm.word.LocationIdentity |
END_IDENTITY |
static FastThreadLocalBytes<ThreadLocalAllocation.Descriptor> |
regularTLAB
TLAB for regular allocations.
|
static org.graalvm.word.LocationIdentity |
TOP_IDENTITY |
Modifier and Type | Method and Description |
---|---|
static org.graalvm.word.Pointer |
allocateMemory(ThreadLocalAllocation.Descriptor allocator,
org.graalvm.word.UnsignedWord size)
The implementation of the AllocationSnippets.fastAllocateImpl(Unsigned).
|
static void |
disableThreadLocalAllocation()
Stop using the current chunk for thread-local allocation.
|
static void |
disableThreadLocalAllocation(org.graalvm.nativeimage.IsolateThread vmThread) |
static org.graalvm.word.UnsignedWord |
getObjectBytes(ThreadLocalAllocation.Descriptor tlab)
Returns the total memory used by the TLAB in bytes.
|
static void |
releaseMemory(ThreadLocalAllocation.Descriptor tlab)
Releases all the memory allocated in this TLAB, without any safety checks that the memory is
no longer referenced from other objects.
|
static void |
resumeThreadLocalAllocation() |
static void |
suspendThreadLocalAllocation() |
static boolean |
verifyUninitialized(ThreadLocalAllocation.Descriptor tlab) |
static boolean |
walkObjects(ObjectVisitor visitor)
Walk objects in this thread's TLABs.
|
public static final org.graalvm.word.LocationIdentity TOP_IDENTITY
public static final org.graalvm.word.LocationIdentity END_IDENTITY
public static final FastThreadLocalBytes<ThreadLocalAllocation.Descriptor> regularTLAB
public static org.graalvm.word.Pointer allocateMemory(ThreadLocalAllocation.Descriptor allocator, org.graalvm.word.UnsignedWord size)
This is bump-pointer allocation for the young generation, using a cached "top" and "end".
Since this is called from a snippet, it and all the methods it calls, must be able to be inlined. The easy way to do that is to make this method, and all the methods it calls, final or static.
This allocates *memory*, not an Object. The rest of the allocation path takes care of turning the memory into an Object.
See also AlignedHeapChunk.allocateMemory(AlignedHeapChunk.AlignedHeader, UnsignedWord).
public static void disableThreadLocalAllocation()
public static void disableThreadLocalAllocation(org.graalvm.nativeimage.IsolateThread vmThread)
public static void suspendThreadLocalAllocation()
public static void resumeThreadLocalAllocation()
public static boolean walkObjects(ObjectVisitor visitor)
public static void releaseMemory(ThreadLocalAllocation.Descriptor tlab)
public static org.graalvm.word.UnsignedWord getObjectBytes(ThreadLocalAllocation.Descriptor tlab)
public static boolean verifyUninitialized(ThreadLocalAllocation.Descriptor tlab)