public static class LockFreePrefixTree.ObjectPoolingAllocator extends LockFreePrefixTree.Allocator
Node.LinearChildren
and
Node.HashChildren
arrays whose length is a power of 2 (because
LockFreePrefixTree
only ever allocates arrays that are a power of 2). If the
requested array length is not a power of 2, an exception is thrown.Constructor and Description |
---|
ObjectPoolingAllocator() |
ObjectPoolingAllocator(int housekeepingPeriodMillis) |
Modifier and Type | Method and Description |
---|---|
org.graalvm.collections.LockFreePrefixTree.Node.HashChildren |
newHashChildren(int length)
Allocates a new reference array of child nodes stored as a hash table.
|
org.graalvm.collections.LockFreePrefixTree.Node.LinearChildren |
newLinearChildren(int length)
Allocates a new reference array of child nodes stored linearly.
|
LockFreePrefixTree.Node |
newNode(long key)
Allocates a new Node object.
|
void |
shutdown()
Releases the allocator's resources.
|
String |
status() |
public ObjectPoolingAllocator()
public ObjectPoolingAllocator(int housekeepingPeriodMillis)
public LockFreePrefixTree.Node newNode(long key)
LockFreePrefixTree.Allocator
newNode
in class LockFreePrefixTree.Allocator
key
- The key to use for the Node
object.Node
object, possibly preallocated.public org.graalvm.collections.LockFreePrefixTree.Node.LinearChildren newLinearChildren(int length)
LockFreePrefixTree.Allocator
newLinearChildren
in class LockFreePrefixTree.Allocator
length
- The length of the allocated array.public org.graalvm.collections.LockFreePrefixTree.Node.HashChildren newHashChildren(int length)
LockFreePrefixTree.Allocator
newHashChildren
in class LockFreePrefixTree.Allocator
length
- The length of the allocated array.public void shutdown()
LockFreePrefixTree.Allocator
shutdown
in class LockFreePrefixTree.Allocator
public String status()