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)
56 : esize(right.esize), csize(right.csize),
57 chunks(right.chunks), head(right.head), nchunks(right.nchunks)
68 if (&right ==
this) {
return *
this; }
69 chunks = right.chunks;
71 nchunks = right.nchunks;
92 G4PoolChunk* n = chunks;
109void G4AllocatorPool::Grow()
114 G4PoolChunk* n =
new G4PoolChunk(csize);
119 const int nelem = csize/esize;
120 char* start = n->mem;
121 char* last = &start[(nelem-1)*esize];
122 for (
char* p=start; p<last; p+=esize)
124 reinterpret_cast<G4PoolLink*
>(p)->next
125 =
reinterpret_cast<G4PoolLink*
>(p+esize);
127 reinterpret_cast<G4PoolLink*
>(last)->next = 0;
128 head =
reinterpret_cast<G4PoolLink*
>(start);
G4AllocatorPool(unsigned int n=0)