Package org.graalvm.collections
Class LockFreePrefixTree.HeapAllocator
java.lang.Object
org.graalvm.collections.LockFreePrefixTree.Allocator
org.graalvm.collections.LockFreePrefixTree.HeapAllocator
- Enclosing class:
LockFreePrefixTree
Allocator that allocates objects directly on the managed heap.
- Since:
- 23.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.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.newNode
(long key) Allocates a new Node object.void
shutdown()
Releases the allocator's resources.
-
Constructor Details
-
HeapAllocator
public HeapAllocator()
-
-
Method Details
-
newNode
Description copied from class:LockFreePrefixTree.Allocator
Allocates a new Node object.- Specified by:
newNode
in classLockFreePrefixTree.Allocator
- Parameters:
key
- The key to use for theNode
object.- Returns:
- A fresh
Node
object, possibly preallocated. - Since:
- 23.0
-
newLinearChildren
public org.graalvm.collections.LockFreePrefixTree.Node.LinearChildren newLinearChildren(int length) Description copied from class:LockFreePrefixTree.Allocator
Allocates a new reference array of child nodes stored linearly.- Specified by:
newLinearChildren
in classLockFreePrefixTree.Allocator
- Parameters:
length
- The length of the allocated array.- Returns:
- A fresh array, possibly preallocated.
- Since:
- 23.0
-
newHashChildren
public org.graalvm.collections.LockFreePrefixTree.Node.HashChildren newHashChildren(int length) Description copied from class:LockFreePrefixTree.Allocator
Allocates a new reference array of child nodes stored as a hash table.- Specified by:
newHashChildren
in classLockFreePrefixTree.Allocator
- Parameters:
length
- The length of the allocated array.- Returns:
- A fresh array, possibly preallocated.
- Since:
- 23.0
-
shutdown
public void shutdown()Description copied from class:LockFreePrefixTree.Allocator
Releases the allocator's resources. Allocator should not be used after calling this method.- Specified by:
shutdown
in classLockFreePrefixTree.Allocator
- Since:
- 23.0
-