#include <mempool.h>
Inheritance diagram for MemPool:
Public Methods | |
MemPool () | |
~MemPool () | |
MemPoolObject< S > * | Allocate (int numels) throw (range_error) |
void | Deallocate (MemPoolObject< S > *dead, int numels) |
Static Public Methods | |
int | FreeBlocks1 () |
int | FreeBlocks2 () |
Static Private Methods | |
MemPoolObject< S > * | allocate_block1 () |
MemPoolObject< S > * | allocate_block2 () |
Static Private Attributes | |
const int | BLOCK_SIZE |
MemPoolObject< S > * | mempool1 |
mempool1 contains only single chunks. More... | |
MemPoolObject< S > * | mempool2 |
mempool2 contains blocks of chunks suitable for arrays. More... |
This memory pool class handles memory management for large numbers of small arrays whose elements are of type S. The normal new[] and delete[] functions for S objects introduce much overhead, so they aren't suitable for the "fromlinks" and "tolinks" Link arrays associated with each WebNode. Instead, MemPool<S> provides Allocate() and Deallocate() member functions to replace new[] and delete[].
Definition at line 159 of file mempool.h.
|
|
|
|
|
Definition at line 182 of file mempool.h. References MemPoolObject< S >::admin_length, MemPoolObject< S >::admin_next, and NULL. |
|
Definition at line 256 of file mempool.h. References MemPoolObject< S >::admin_next, and MemPool< S >::BLOCK_SIZE. |
|
Definition at line 269 of file mempool.h. References MemPoolObject< S >::admin_length, MemPoolObject< S >::admin_next, and MemPool< S >::BLOCK_SIZE. |
|
Definition at line 301 of file mempool.h. References MemPoolObject< S >::admin_length, MemPoolObject< S >::admin_next, MemPool< S >::mempool1, and MemPool< S >::mempool2. |
|
Definition at line 279 of file mempool.h. References MemPoolObject< S >::admin_next, and MemPool< S >::mempool1. Referenced by GraphBuilder::StatisticsMem(). |
|
Definition at line 290 of file mempool.h. References MemPoolObject< S >::admin_length, MemPoolObject< S >::admin_next, and MemPool< S >::mempool2. Referenced by GraphBuilder::StatisticsMem(). |
|
Definition at line 173 of file mempool.h. Referenced by MemPool< S >::allocate_block1(), and MemPool< S >::allocate_block2(). |
|
mempool1 contains only single chunks.
Definition at line 177 of file mempool.h. Referenced by MemPool< S >::Deallocate(), and MemPool< S >::FreeBlocks1(). |
|
mempool2 contains blocks of chunks suitable for arrays.
Definition at line 178 of file mempool.h. Referenced by MemPool< S >::Deallocate(), and MemPool< S >::FreeBlocks2(). |