#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 |
◆ Free()
void G4AllocatorPool::Free |
( |
void * |
b | ) |
|
|
inline |
◆ GetNoPages()
int G4AllocatorPool::GetNoPages |
( |
| ) |
const |
|
inline |
◆ GetPageSize()
unsigned int G4AllocatorPool::GetPageSize |
( |
| ) |
const |
|
inline |
◆ Grow()
void G4AllocatorPool::Grow |
( |
| ) |
|
|
private |
Definition at line 101 of file G4AllocatorPool.cc.
102{
103
104
105
106 G4PoolChunk*
n =
new G4PoolChunk(
csize);
110
112 char* start =
n->mem;
113 char* last = &start[(nelem - 1) *
esize];
114 for(
char* p = start; p < last; p +=
esize)
115 {
116 reinterpret_cast<G4PoolLink*>(p)->next =
117 reinterpret_cast<G4PoolLink*
>(p +
esize);
118 }
119 reinterpret_cast<G4PoolLink*>(last)->next = nullptr;
120 head =
reinterpret_cast<G4PoolLink*
>(start);
121}
References chunks, csize, esize, head, CLHEP::detail::n, and nchunks.
Referenced by Alloc().
◆ GrowPageSize()
void G4AllocatorPool::GrowPageSize |
( |
unsigned int |
factor | ) |
|
|
inline |
◆ operator=()
◆ Reset()
void G4AllocatorPool::Reset |
( |
| ) |
|
◆ Size()
unsigned int G4AllocatorPool::Size |
( |
| ) |
const |
|
inline |
◆ chunks
◆ csize
unsigned int G4AllocatorPool::csize |
|
private |
◆ esize
const unsigned int G4AllocatorPool::esize |
|
private |
◆ head
◆ nchunks
int G4AllocatorPool::nchunks = 0 |
|
private |
The documentation for this class was generated from the following files: