16 #ifdef CH_USE_MEMORY_TRACKING 25 #ifdef CH_USE_MEMORY_TRACKING 27 typedef std::list<Arena*> ArenaList;
59 virtual void*
alloc(
size_t a_sz) = 0;
64 virtual void free(
void* a_pt) = 0;
72 static size_t align(
size_t a_sz);
76 #ifdef CH_USE_MEMORY_TRACKING 82 static ArenaList* arenaList_;
111 size_t x = a_s +
sizeof(Word) - 1;
112 x -= x %
sizeof(Word);
132 BArena(
const char* a_name =
"unnamed");
134 BArena(
const std::string& a_name);
139 virtual void*
alloc (
size_t a_sz);
142 virtual void free (
void* a_pt);
160 CArena(
size_t a_hunk_size = 0);
166 virtual void*
alloc(
size_t a_nbytes);
171 virtual void free(
void* a_vp);
178 void* calloc(
size_t a_nmemb,
185 void* realloc (
void* a_ptr,
192 DefaultHunkSize = 1024*1024
215 Node(
void* a_block,
size_t a_size)
223 Node(
const Node& a_rhs)
225 m_block(a_rhs.m_block),
231 Node& operator = (
const Node& a_rhs)
233 m_block = a_rhs.m_block;
234 m_size = a_rhs.m_size;
242 return m_block < a_rhs.m_block;
247 bool operator == (
const Node& a_rhs)
const 249 return m_block == a_rhs.m_block;
261 void block (
void* a_blk)
275 void size(
size_t a_sz)
295 typedef set < Node > NL;
300 std::vector<void*> m_alloc;
static size_t align(size_t a_sz)
Definition: Arena.H:109
A Concrete Class for Dynamic Memory Management.
Definition: Arena.H:124
virtual void * alloc(size_t a_sz)=0
virtual void free(void *a_pt)=0
Arena()
base class constructor
A Virtual Base Class for Dynamic Memory Managemen.
Definition: Arena.H:40
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:212
virtual ~Arena()
base class destructor.
A Concrete Class for Dynamic Memory Management.
Definition: Arena.H:153
void(* FP)()
Definition: Arena.H:74