#include <source/toolbox/memory/Arena.h>
Inheritance diagram for SAMRAI::tbox::Arena:
Public Member Functions | |
Arena () | |
virtual | ~Arena () |
virtual void * | alloc (const size_t bytes)=0 |
virtual void | free (void *p)=0 |
Static Public Member Functions | |
static size_t | align (const size_t bytes) |
SAMRAI::tbox::Arena::Arena | ( | ) | [inline] |
The constructor for Arena.
SAMRAI::tbox::Arena::~Arena | ( | ) | [virtual] |
The virtual destructor for Arena.
virtual void* SAMRAI::tbox::Arena::alloc | ( | const size_t | bytes | ) | [pure virtual] |
Abstract virtual function to allocate memory from the arena.
Implemented in SAMRAI::tbox::FixedArena, SAMRAI::tbox::ScratchArena, and SAMRAI::tbox::StandardArena.
virtual void SAMRAI::tbox::Arena::free | ( | void * | p | ) | [pure virtual] |
Abstract virtual function to return memory to the arena memory pool.
Implemented in SAMRAI::tbox::FixedArena, SAMRAI::tbox::ScratchArena, and SAMRAI::tbox::StandardArena.
size_t SAMRAI::tbox::Arena::align | ( | const size_t | bytes | ) | [inline, static] |
Static arena function to compute alignment for memory allocation. Data allocations less than the alignment size are rounded up to the next multiple of the allocation size. All data allocations are aligned on 16 byte boundaries. Thus, a memory allocation of only 9 bytes will actually return a 16 byte chunk of memory.