#include <source/toolbox/memory/FixedArena.h>
Inheritance diagram for SAMRAI::tbox::FixedArena:
Public Member Functions | |
FixedArena (const size_t bytes) | |
virtual | ~FixedArena () |
virtual void * | alloc (const size_t bytes) |
virtual void | free (void *p) |
virtual Pointer< Arena > | allocateArena (const size_t bytes) |
virtual void | printClassData (ostream &os) const |
Note that the size of the memory arena must be calculated including alignment space; all memory requests are aligned on boundaries as defined by Arena::align().
|
Allocate a fixed-size memory arena. Multiple allocation requests may be made to this arena via alloc() and the specially defined new operators (see Arena). The size of the fixed arena must include padding space, since all memory will be allocated aligned as defined in Arena. |
|
Release the memory associated with the fixed arena. Objects that allocate from a fixed arena must make sure that the arena lives longer than the need for the buffer space. To ensure that the fixed arena lives long enough, objects might wish to cache a smart pointer to the arena object so that the actual arena object is not deleted until all objects using the arena are deleted. |
|
Allocate an aligned portion of memory from the fixed arena. Allocations that exceed the arena space cause the program to abort with a memory overrun exception. Implements SAMRAI::tbox::Arena. |
|
Return allocated memory to the fixed arena. For FixedArena, the memory is not actually returned to the free memory pool until the object is destroyed. Thus, free() is a null operation. Implements SAMRAI::tbox::Arena. |
|
Allocate a fixed arena of the specified size. Subclasses should override allocateArena() to return the proper subclass type. |
|
Print out internal class data for debugging. |