#include <G4AllocatorPool.hh>
Definition at line 50 of file G4AllocatorPool.hh.
◆ G4AllocatorPool()
G4AllocatorPool::G4AllocatorPool |
( |
unsigned int |
n = 0 | ) |
|
|
explicit |
Definition at line 44 of file G4AllocatorPool.cc.
45 : esize(sz<sizeof(G4PoolLink) ? sizeof(G4PoolLink) : sz),
46 csize(sz<1024/2-16 ? 1024-16 : sz*10-16),
47 chunks(0), head(0), nchunks(0)
48{
49}
◆ ~G4AllocatorPool()
G4AllocatorPool::~G4AllocatorPool |
( |
| ) |
|
◆ Alloc()
void * G4AllocatorPool::Alloc |
( |
| ) |
|
|
inline |
Definition at line 119 of file G4AllocatorPool.hh.
120{
121 if (head==0) { Grow(); }
122 G4PoolLink* p = head;
123 head = p->next;
124 return p;
125}
◆ Free()
void G4AllocatorPool::Free |
( |
void * |
b | ) |
|
|
inline |
Definition at line 132 of file G4AllocatorPool.hh.
133{
134 G4PoolLink* p = static_cast<G4PoolLink*>(b);
135 p->next = head;
136 head = p;
137}
◆ GetNoPages()
int G4AllocatorPool::GetNoPages |
( |
| ) |
const |
|
inline |
◆ GetPageSize()
unsigned int G4AllocatorPool::GetPageSize |
( |
| ) |
const |
|
inline |
◆ GrowPageSize()
void G4AllocatorPool::GrowPageSize |
( |
unsigned int |
factor | ) |
|
|
inline |
◆ Reset()
void G4AllocatorPool::Reset |
( |
| ) |
|
Definition at line 88 of file G4AllocatorPool.cc.
89{
90
91
92 G4PoolChunk*
n = chunks;
93 G4PoolChunk* p = 0;
94 while (n)
95 {
98 delete p;
99 }
100 head = 0;
101 chunks = 0;
102 nchunks = 0;
103}
Referenced by ~G4AllocatorPool().
◆ Size()
unsigned int G4AllocatorPool::Size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: