#include <pool.h>
Public Member Functions | |
| SimplePool (size_t, size_t) | |
| ~SimplePool () | |
| Return the memory to the system. | |
| size_t | maxAlloc () const |
| size_t | instance () const |
| void * | allocate (size_t n) |
| Returns a pointer to the beginning of n units of memory in this SimplePool. | |
| void | deallocate (void *ptr, size_t n) |
| Does nothing! | |
Static Public Member Functions | |
| void | allowReport () |
| size_t | numInstances () |
| void | memoryReport () |
| Writes a report on the various pool constructions and destructions in the memory log file. | |
Private Member Functions | |
| void * | newBlock () |
| void | reportDestruction () |
| Writes down data about the memory usage of the pool. | |
Private Attributes | |
| const size_t | d_systemRequest |
| const size_t | d_atomSize |
| Size in machine words of each object stored in this SimplePool. | |
| const size_t | d_instance |
| Which instance of SimplePool this is. | |
| char * | d_free |
| Pointer to the first free unit of memory in this SimplePool. | |
| char * | d_top |
| Pointer to the first byte beyond the available memory in this simple pool. | |
| size_t | d_used |
| Tells how many units of memory have been assigned by this SimplePool. | |
| size_t | d_allocated |
| Tells how many units of memory have been prepared for use by this SimplePool. | |
| std::vector< void * > | d_systemAllocs |
| Entry #j is a pointer to the beginning of the jth block (of size (d_atomSize)(2^d_systemRequest)) assigned by the system to this SimplePool. | |
Static Private Attributes | |
| size_t | instances = 0 |
| Incremented each time SimplePool is instantiated, and decremented when a SimplePool is destroyed, so that it counts the number of SimplePool's. | |
| size_t | constructions = 0 |
| Incremented each time SimplePool is instantiated, but not decremented when a SimplePool is destroyed. | |
| const char * | logfile = "simplepool.log" |
| Report on the activity of SimplePool. | |
| bool | done = false |
Each allocation will be of size d_atomSize. Memory is requested from the system in blocks of size (d_atomSize)(2^d_systemRequest); pointers to the beginning of each such request are in d_systemAllocs.
Definition at line 175 of file pool.h.
|
||||||||||||
|
|
|
|
Return the memory to the system.
Definition at line 387 of file pool.cpp. References d_systemAllocs, instances, memoryReport(), and reportDestruction(). |
|
|
Returns a pointer to the beginning of n units of memory in this SimplePool. It is required that n = 1, or there will be serious memory problems. Definition at line 404 of file pool.cpp. References d_free, and newBlock(). |
|
|
|
|
||||||||||||
|
Does nothing! It is required that n = 1, or there will be serious memory problems. |
|
|
|
|
|
|
|
|
Writes a report on the various pool constructions and destructions in the memory log file.
Definition at line 431 of file pool.cpp. References atlas::pool::helper::SimplePoolDestruct::d_allocated, atlas::pool::helper::SimplePoolDestruct::d_instance, atlas::pool::helper::SimplePoolDestruct::d_systemAllocs, logfile, and atlas::pool::helper::simplePoolDestructions. Referenced by ~SimplePool(). |
|
|
Definition at line 463 of file pool.cpp. References d_allocated, d_atomSize, d_free, d_systemAllocs, d_systemRequest, and d_top. Referenced by allocate(). |
|
|
|
|
|
Writes down data about the memory usage of the pool.
Definition at line 490 of file pool.cpp. References atlas::pool::helper::SimplePoolDestruct::d_allocated, atlas::pool::helper::SimplePoolDestruct::d_instance, d_systemAllocs, atlas::pool::helper::SimplePoolDestruct::d_systemAllocs, and atlas::pool::helper::simplePoolDestructions. Referenced by ~SimplePool(). |
|
|
Incremented each time SimplePool is instantiated, but not decremented when a SimplePool is destroyed.
|
|
|
Tells how many units of memory have been prepared for use by this SimplePool.
Definition at line 234 of file pool.h. Referenced by newBlock(). |
|
|
Size in machine words of each object stored in this SimplePool.
Definition at line 203 of file pool.h. Referenced by newBlock(). |
|
|
Pointer to the first free unit of memory in this SimplePool.
Definition at line 214 of file pool.h. Referenced by allocate(), and newBlock(). |
|
|
Which instance of SimplePool this is.
|
|
|
Entry #j is a pointer to the beginning of the jth block (of size (d_atomSize)(2^d_systemRequest)) assigned by the system to this SimplePool.
Definition at line 241 of file pool.h. Referenced by newBlock(), reportDestruction(), and ~SimplePool(). |
|
|
Definition at line 198 of file pool.h. Referenced by newBlock(). |
|
|
Pointer to the first byte beyond the available memory in this simple pool. Refers always to the most recent system allocation. Definition at line 222 of file pool.h. Referenced by newBlock(). |
|
|
Tells how many units of memory have been assigned by this SimplePool.
|
|
|
|
|
|
Incremented each time SimplePool is instantiated, and decremented when a SimplePool is destroyed, so that it counts the number of SimplePool's.
Definition at line 40 of file pool.cpp. Referenced by ~SimplePool(). |
|
|
Report on the activity of SimplePool.
Definition at line 42 of file pool.cpp. Referenced by memoryReport(). |
1.3.9.1