Class TempAllocatorImpl

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class TempAllocatorImpl extends TempAllocator
A last-in/first-out implementation of TempAllocator.
  • Constructor Details

    • TempAllocatorImpl

      public TempAllocatorImpl(int numBytes)
      Instantiate a LIFO allocator with the specified capacity.
      Parameters:
      numBytes - the desired capacity (in bytes)
  • Method Details

    • getSize

      public int getSize()
      Return the total capacity of the allocator.
      Returns:
      the capacity in bytes
    • getUsage

      public int getUsage()
      Return the amount of memory currently allocated.
      Returns:
      the number of bytes used (≥0)
    • isEmpty

      public boolean isEmpty()
      Test whether any memory is currently allocated.
      Returns:
      true if no memory is allocated, or false if memory is allocated