49 static list<CObstack*>* obstackList;
54 typedef struct obstackChunk_tag {
55 struct obstackChunk_tag *next;
62 static const int OBSTACK_DEFAULT_BLOCK_SIZE =
66 Chunk_t* currentChunk;
77 static void OnExitDumpStats();
84 CObstack(
const char* name,
int chunkSize = OBSTACK_DEFAULT_BLOCK_SIZE );
94 void* Alloc(
INT32 size );
99 void Free(
void*
object );
106 void* GetBase(
void );
113 void* NextFree(
void );
120 void* Finish(
void );
127 void* Copy(
const void* ptr,
INT32 size );
135 void* Copy0(
const void* ptr,
INT32 size );
140 INT32 GetObjectSize(
void );
147 void Grow(
const void* ptr,
INT32 size );
153 void Grow(
INT32 size );
159 void PtrGrow(
void* ptr );
165 int IsOwner(
void* ptr );
170 static void _OnExitDumpStats();
172 void* GrowChunk(
INT32 );
188 typename vector<T*>::iterator ptr;
190 for( ptr = v.begin(); ptr != v.end(); ++ptr ) {
191 heap->
Grow( &*ptr,
sizeof(T*) );
194 v.erase( v.begin(), v.end() );
195 return (T**)heap->
Finish();
199 #endif // COBSTACK_HPP void * Finish(void)
Finialized the object.
long INT32
Short cut for signed 32 bit integer.
Definition: glue.h:38
Bulk object allocation object.
Definition: cobstack.h:46
void Grow(const void *ptr, INT32 size)
Grow current object and copy block of data to heap.
T ** Finalize(CObstack *heap, vector< T * > &v)
Transfer vector of pointers to a linear array allocated on the given obstack.
Definition: cobstack.h:185
void PtrGrow(void *ptr)
Grow current object and copy pointer to heap.