#include <G4AllocatorPool.hh>
Definition at line 44 of file G4AllocatorPool.hh.
◆ G4AllocatorPool() [1/2]
G4AllocatorPool::G4AllocatorPool |
( |
unsigned int |
n = 0 | ) |
|
|
explicit |
Definition at line 37 of file G4AllocatorPool.cc.
38 : esize(sz < sizeof(G4PoolLink) ? sizeof(G4PoolLink) : sz)
39 , csize(sz < 1024 / 2 - 16 ? 1024 - 16 : sz * 10 - 16)
40{}
◆ ~G4AllocatorPool()
G4AllocatorPool::~G4AllocatorPool |
( |
| ) |
|
◆ G4AllocatorPool() [2/2]
Definition at line 46 of file G4AllocatorPool.cc.
47 : esize(right.esize)
48 , csize(right.csize)
49 , chunks(right.chunks)
50 , head(right.head)
51 , nchunks(right.nchunks)
52{}
◆ Alloc()
void * G4AllocatorPool::Alloc |
( |
| ) |
|
|
inline |
Definition at line 114 of file G4AllocatorPool.hh.
115{
116 if(head == 0)
117 {
118 Grow();
119 }
120 G4PoolLink* p = head;
121 head = p->next;
122 return p;
123}
◆ Free()
void G4AllocatorPool::Free |
( |
void * |
b | ) |
|
|
inline |
Definition at line 129 of file G4AllocatorPool.hh.
130{
131 G4PoolLink* p = static_cast<G4PoolLink*>(b);
132 p->next = head;
133 head = p;
134}
◆ GetNoPages()
int G4AllocatorPool::GetNoPages |
( |
| ) |
const |
|
inline |
◆ GetPageSize()
unsigned int G4AllocatorPool::GetPageSize |
( |
| ) |
const |
|
inline |
◆ GrowPageSize()
void G4AllocatorPool::GrowPageSize |
( |
unsigned int |
factor | ) |
|
|
inline |
◆ operator=()
Definition at line 58 of file G4AllocatorPool.cc.
59{
60 if(&right == this)
61 {
62 return *this;
63 }
64 chunks = right.chunks;
65 head = right.head;
66 nchunks = right.nchunks;
67 return *this;
68}
◆ Reset()
void G4AllocatorPool::Reset |
( |
| ) |
|
Definition at line 80 of file G4AllocatorPool.cc.
81{
82
83
84 G4PoolChunk*
n = chunks;
85 G4PoolChunk* p = nullptr;
86 while(n)
87 {
90 delete p;
91 }
92 head = nullptr;
93 chunks = nullptr;
94 nchunks = 0;
95}
Referenced by ~G4AllocatorPool().
◆ Size()
unsigned int G4AllocatorPool::Size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: