Chombo + EB  3.0
Public Types | Public Member Functions | Private Member Functions | List of all members
CArena Class Reference

A Concrete Class for Dynamic Memory Management. More...

#include <Arena.H>

Inheritance diagram for CArena:
Inheritance graph
[legend]

Public Types

enum  { DefaultHunkSize = 1024*1024 }
 The default memory hunk size to grab from the heap. More...
 
- Public Types inherited from Arena
typedef void(* FP) ()
 

Public Member Functions

 CArena (size_t a_hunk_size=0)
 
virtual ~CArena ()
 The destructor. More...
 
virtual void * alloc (size_t a_nbytes)
 Allocate some memory. More...
 
virtual void free (void *a_vp)
 
- Public Member Functions inherited from Arena
 Arena ()
 base class constructor More...
 
virtual ~Arena ()
 base class destructor. More...
 

Private Member Functions

 CArena (const CArena &a_rhs)
 
CArenaoperator= (const CArena &a_rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from Arena
static size_t align (size_t a_sz)
 

Detailed Description

A Concrete Class for Dynamic Memory Management.

This is a coalescing memory manager. It allocates (possibly) large chunks of heap space and apportions it out as requested. It merges together neighboring chunks on each free().

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The default memory hunk size to grab from the heap.

Enumerator
DefaultHunkSize 

Constructor & Destructor Documentation

◆ CArena() [1/2]

CArena::CArena ( size_t  a_hunk_size = 0)

: Construct a coalescing memory manager. `a_hunk_size' is the minimum size of hunks of memory to allocate from the heap. If a_hunk_size == 0 we use DefaultHunkSize as specified below.

◆ ~CArena()

virtual CArena::~CArena ( )
virtual

The destructor.

◆ CArena() [2/2]

CArena::CArena ( const CArena a_rhs)
private

Member Function Documentation

◆ alloc()

virtual void* CArena::alloc ( size_t  a_nbytes)
virtual

Allocate some memory.

Implements Arena.

◆ free()

virtual void CArena::free ( void *  a_vp)
virtual

Free up allocated memory. Merge neighboring free memory chunks into largest possible chunk.

Implements Arena.

◆ operator=()

CArena& CArena::operator= ( const CArena a_rhs)
private

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