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

#include <tbox/ScratchArena.h>

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

Public Member Functions

 ScratchArena ()
 
virtual ~ScratchArena ()
 
virtual void * alloc (const size_t bytes)
 
virtual void free (void *p)
 

Static Public Member Functions

static size_t align (const size_t bytes)
 

Private Types

enum  { ArenaAllocationAlignment = 16 }
 

Private Member Functions

 ScratchArena (const ScratchArena &)
 
void operator= (const ScratchArena &)
 

Detailed Description

Class ScratchArena is intended for temporary memory allocation from a scratch arena. However, ScratchArena currently uses the standard C++ new and delete operators for memory allocation and deallocation.

See also
tbox::Arena

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
ArenaAllocationAlignment 

Constructor & Destructor Documentation

◆ ScratchArena() [1/2]

SAMRAI::tbox::ScratchArena::ScratchArena ( )

The constructor for the scratch memory arena.

◆ ~ScratchArena()

virtual SAMRAI::tbox::ScratchArena::~ScratchArena ( )
virtual

The virtual destructor for the scratch memory arena.

◆ ScratchArena() [2/2]

SAMRAI::tbox::ScratchArena::ScratchArena ( const ScratchArena )
private

Member Function Documentation

◆ alloc()

virtual void* SAMRAI::tbox::ScratchArena::alloc ( const size_t  bytes)
virtual

Allocate memory from the scratch arena. The current implementation of ScratchArena simply uses the standard C++ new operator.

Implements SAMRAI::tbox::Arena.

◆ free()

virtual void SAMRAI::tbox::ScratchArena::free ( void *  p)
virtual

Return memory to the scratch arena pool. The current implementation of ScratchArena simply uses the standard C++ delete operator.

Implements SAMRAI::tbox::Arena.

◆ operator=()

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

◆ align()

static size_t SAMRAI::tbox::Arena::align ( const size_t  bytes)
staticinherited

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 file: