SAMRAI::tbox::Arena Class Reference

#include <source/toolbox/memory/Arena.h>

Inheritance diagram for SAMRAI::tbox::Arena:

Inheritance graph
[legend]
List of all members.

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)

Detailed Description

Class Arena is an abstract base class for specialized dynamic memory management. The ``arena'' is a user-controlled portion of memory that is accessed via a special ``new'' command. Memory allocated in this manner must be returned to the arena using the arena free() function; C++ does not (unfortunately) understand a corresponding form of delete. However, memory management classes such as Pointer and Array can alleviate this burden.

See also:
tbox::Array

tbox::Pointer


Constructor & Destructor Documentation

SAMRAI::tbox::Arena::Arena (  )  [inline]

The constructor for Arena.

SAMRAI::tbox::Arena::~Arena (  )  [virtual]

The virtual destructor for Arena.


Member Function Documentation

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.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:29:01 2009 for SAMRAI by  doxygen 1.5.1