Class LockFreePrefixTree.Allocator

java.lang.Object
org.graalvm.collections.LockFreePrefixTree.Allocator
Direct Known Subclasses:
LockFreePrefixTree.HeapAllocator, LockFreePrefixTree.ObjectPoolingAllocator
Enclosing class:
LockFreePrefixTree

public abstract static class LockFreePrefixTree.Allocator extends Object
Policy for allocating objects of the lock-free prefix tree.
Since:
23.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract 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.
    newNode(long key)
    Allocates a new Node object.
    abstract void
    Releases the allocator's resources.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Allocator

      public Allocator()
  • Method Details

    • newNode

      public abstract LockFreePrefixTree.Node newNode(long key)
      Allocates a new Node object.
      Parameters:
      key - The key to use for the Node 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