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);
140 virtual void*
alloc (
size_t a_sz);
143 virtual void free (
void* a_pt);
161 CArena(
size_t a_hunk_size = 0);
167 virtual void*
alloc(
size_t a_nbytes);
172 virtual void free(
void* a_vp);
179 void* calloc(
size_t a_nmemb,
186 void* realloc (
void* a_ptr,
193 DefaultHunkSize = 1024*1024
216 Node(
void* a_block,
size_t a_size)
224 Node(
const Node& a_rhs)
226 m_block(a_rhs.m_block),
232 Node& operator = (
const Node& a_rhs)
234 m_block = a_rhs.m_block;
235 m_size = a_rhs.m_size;
243 return m_block < a_rhs.m_block;
248 bool operator == (
const Node& a_rhs)
const 250 return m_block == a_rhs.m_block;
262 void block (
void* a_blk)
276 void size(
size_t a_sz)
297 typedef set < Node > NL;
302 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:204
virtual ~Arena()
base class destructor.
A Concrete Class for Dynamic Memory Management.
Definition: Arena.H:154
void(* FP)()
Definition: Arena.H:74