38 : esize(sz < sizeof(G4PoolLink) ? sizeof(G4PoolLink) : sz)
39 , csize(sz < 1024 / 2 - 16 ? 1024 - 16 : sz * 10 - 16)
52 chunks = right.chunks;
54 nchunks = right.nchunks;
72 G4PoolChunk* n = chunks;
73 G4PoolChunk* p =
nullptr;
89void G4AllocatorPool::Grow()
94 auto* n =
new G4PoolChunk(csize);
99 const int nelem = csize / esize;
100 char* start = n->mem;
101 char* last = &start[(nelem - 1) * esize];
102 for(
char* p = start; p < last; p += esize)
104 reinterpret_cast<G4PoolLink*
>(p)->next =
105 reinterpret_cast<G4PoolLink*
>(p + esize);
107 reinterpret_cast<G4PoolLink*
>(last)->next =
nullptr;
108 head =
reinterpret_cast<G4PoolLink*
>(start);
G4AllocatorPool & operator=(const G4AllocatorPool &right)
G4AllocatorPool(unsigned int n=0)