Arena

An arena manages a contiguous region of memory by dividing it into chunks.

Synopsis

Declared in <support/lockedpool.h>

class Arena;

Types

NameDescription
Stats Memory statistics.

Member Functions

NameDescription
Arena [constructor]Constructors
~Arena [destructor] [virtual]Destroys the arena.
operator= [deleted]Deleted copy assignment; an Arena cannot be copied.
addressInArena Return whether a pointer points inside this arena. This returns base <= ptr < (base+size) so only use it for (inclusive) chunk starting addresses.
alloc Allocate size bytes from this arena. Returns pointer on success, or 0 if memory is full or the application tried to allocate 0 bytes.
free Free a previously allocated chunk of memory. Freeing the zero pointer has no effect. Raises std::runtime_error in case of error.
stats Get arena usage statistics