Allocator pool.
More...
#include <GaudiKernel/AllocatorPool.h>
Allocator pool.
Class is imported from Geant4 project
- Date
- 2006-02-14
Definition at line 65 of file AllocatorPool.h.
| GaudiUtils::AllocatorPool::AllocatorPool |
( |
unsigned int |
n = 0 | ) |
|
|
explicit |
Create a pool of elements of size n.
Definition at line 53 of file AllocatorPool.cpp.
:
esize(sz<
sizeof(PoolLink) ?
sizeof(PoolLink) : sz),
csize(sz<1024/2-16 ? 1024-16 : sz*10-16),
{}
| GaudiUtils::AllocatorPool::~AllocatorPool |
( |
| ) |
|
| GaudiUtils::AllocatorPool::AllocatorPool |
( |
const AllocatorPool & |
right | ) |
|
| 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);
}
| void GaudiUtils::AllocatorPool::Grow |
( |
| ) |
|
|
private |
Make pool larger.
Definition at line 118 of file AllocatorPool.cpp.
{
PoolChunk* n =
new PoolChunk(
csize);
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;
}
Private equality operator.
Definition at line 75 of file AllocatorPool.cpp.
{
if (&right == this) { return *this; }
return *this;
}
| void GaudiUtils::AllocatorPool::Reset |
( |
| ) |
|
Return storage to the free store.
Definition at line 97 of file AllocatorPool.cpp.
{
PoolChunk* p = 0;
while (n)
{
p = n;
delete p;
}
}
| unsigned int GaudiUtils::AllocatorPool::Size |
( |
| ) |
const |
|
inline |
| const unsigned int GaudiUtils::AllocatorPool::csize |
|
private |
| const unsigned int GaudiUtils::AllocatorPool::esize |
|
private |
| PoolLink* GaudiUtils::AllocatorPool::head |
|
private |
| int GaudiUtils::AllocatorPool::nchunks |
|
private |
The documentation for this class was generated from the following files:
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v24r2/GaudiKernel/GaudiKernel/AllocatorPool.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v24r2/GaudiKernel/src/Lib/AllocatorPool.cpp