Package org.graalvm.collections
Class LockFreePrefixTree.Allocator
java.lang.Object
org.graalvm.collections.LockFreePrefixTree.Allocator
- Direct Known Subclasses:
LockFreePrefixTree.HeapAllocator
,LockFreePrefixTree.ObjectPoolingAllocator
- Enclosing class:
LockFreePrefixTree
Policy for allocating objects of the lock-free prefix tree.
- Since:
- 23.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract org.graalvm.collections.LockFreePrefixTree.Node.HashChildren
newHashChildren
(int length) Allocates a new reference array of child nodes stored as a hash table.abstract org.graalvm.collections.LockFreePrefixTree.Node.LinearChildren
newLinearChildren
(int length) Allocates a new reference array of child nodes stored linearly.abstract LockFreePrefixTree.Node
newNode
(long key) Allocates a new Node object.abstract void
shutdown()
Releases the allocator's resources.
-
Constructor Details
-
Allocator
public Allocator()
-
-
Method Details
-
newNode
Allocates a new Node object.- Parameters:
key
- The key to use for theNode
object.- Returns:
- A fresh
Node
object, possibly preallocated. - Throws:
org.graalvm.collections.LockFreePrefixTree.FailedAllocationException
- If the allocation request cannot be fulfilled.- Since:
- 23.0
-
newLinearChildren
public abstract org.graalvm.collections.LockFreePrefixTree.Node.LinearChildren newLinearChildren(int length) Allocates a new reference array of child nodes stored linearly.- Parameters:
length
- The length of the allocated array.- Returns:
- A fresh array, possibly preallocated.
- Throws:
org.graalvm.collections.LockFreePrefixTree.FailedAllocationException
- If the allocation request cannot be fulfilled.- Since:
- 23.0
-
newHashChildren
public abstract org.graalvm.collections.LockFreePrefixTree.Node.HashChildren newHashChildren(int length) Allocates a new reference array of child nodes stored as a hash table.- Parameters:
length
- The length of the allocated array.- Returns:
- A fresh array, possibly preallocated.
- Throws:
org.graalvm.collections.LockFreePrefixTree.FailedAllocationException
- If the allocation request cannot be fulfilled.- Since:
- 23.0
-
shutdown
public abstract void shutdown()Releases the allocator's resources. Allocator should not be used after calling this method.- Since:
- 23.0
-