Allocator pool.
More...
#include <GaudiKernel/AllocatorPool.h>
List of all members.
Detailed Description
Allocator pool.
Class is imported from Geant4 project
- Date:
- 2006-02-14
Definition at line 65 of file AllocatorPool.h.
Constructor & Destructor Documentation
| GaudiUtils::AllocatorPool::AllocatorPool |
( |
unsigned int |
n = 0 ) |
[explicit] |
| GaudiUtils::AllocatorPool::~AllocatorPool |
( |
) |
|
| GaudiUtils::AllocatorPool::AllocatorPool |
( |
const AllocatorPool & |
right ) |
|
Member Function Documentation
| void * GaudiUtils::AllocatorPool::Alloc |
( |
) |
[inline] |
| void GaudiUtils::AllocatorPool::Free |
( |
void * |
b ) |
[inline] |
Return an element back to the pool.
Definition at line 140 of file AllocatorPool.h.
{
PoolLink* p = static_cast<PoolLink*>(b);
p->next = head;
head = p;
}
| void GaudiUtils::AllocatorPool::Grow |
( |
) |
[private] |
Make pool larger.
Definition at line 118 of file AllocatorPool.cpp.
{
PoolChunk* n = new PoolChunk(csize);
n->next = chunks;
chunks = n;
nchunks++;
const int nelem = csize/esize;
char* start = n->mem;
char* last = &start[(nelem-1)*esize];
for (char* p=start; p<last; p+=esize)
{
reinterpret_cast<PoolLink*>(p)->next
= reinterpret_cast<PoolLink*>(p+esize);
}
reinterpret_cast<PoolLink*>(last)->next = 0;
head = reinterpret_cast<PoolLink*>(start);
}
| void GaudiUtils::AllocatorPool::Reset |
( |
) |
|
| unsigned int GaudiUtils::AllocatorPool::Size |
( |
) |
const [inline] |
Member Data Documentation
The documentation for this class was generated from the following files:
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r2/GaudiKernel/GaudiKernel/AllocatorPool.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r2/GaudiKernel/src/Lib/AllocatorPool.cpp