#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]
◆ Alloc()
void * G4AllocatorPool::Alloc |
( |
| ) |
|
|
inline |
Definition at line 114 of file G4AllocatorPool.hh.
115{
116 if(head == nullptr)
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 auto* 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 |
Definition at line 158 of file G4AllocatorPool.hh.
159{
160 csize = (sz) != 0u ? sz * csize : csize;
161}
◆ operator=()
Definition at line 46 of file G4AllocatorPool.cc.
47{
48 if(&right == this)
49 {
50 return *this;
51 }
52 chunks = right.chunks;
53 head = right.head;
54 nchunks = right.nchunks;
55 return *this;
56}
◆ Reset()
void G4AllocatorPool::Reset |
( |
| ) |
|
Definition at line 68 of file G4AllocatorPool.cc.
69{
70
71
72 G4PoolChunk*
n = chunks;
73 G4PoolChunk* p = nullptr;
74 while(n != nullptr)
75 {
78 delete p;
79 }
80 head = nullptr;
81 chunks = nullptr;
82 nchunks = 0;
83}
Referenced by ~G4AllocatorPool().
◆ Size()
unsigned int G4AllocatorPool::Size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: