IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | List of all members
SAMRAI::tbox::Arena Class Referenceabstract

#include <tbox/Arena.h>

Inheritance diagram for SAMRAI::tbox::Arena:
Inheritance graph
[legend]

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)
 

Private Types

enum  { ArenaAllocationAlignment = 16 }
 

Private Member Functions

 Arena (const Arena &)
 
void operator= (const Arena &)
 

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 specialnew'' 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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ArenaAllocationAlignment 

Constructor & Destructor Documentation

◆ Arena() [1/2]

SAMRAI::tbox::Arena::Arena ( )

The constructor for Arena.

◆ ~Arena()

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

The virtual destructor for Arena.

◆ Arena() [2/2]

SAMRAI::tbox::Arena::Arena ( const Arena )
private

Member Function Documentation

◆ alloc()

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.

◆ free()

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::StandardArena, and SAMRAI::tbox::ScratchArena.

◆ align()

static size_t SAMRAI::tbox::Arena::align ( const size_t  bytes)
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.

◆ operator=()

void SAMRAI::tbox::Arena::operator= ( const Arena )
private

The documentation for this class was generated from the following file: