17 #include "StMemoryPool.hh"
20 StMemoryPool::StMemoryPool(
unsigned int sz)
21 : esize(sz<sizeof(Link*) ? sizeof(Link*) : sz)
27 StMemoryPool::~StMemoryPool()
44 const int nelem = Chunk::size/esize;
46 char* last = &start[(nelem-1)*esize];
48 for (
char* p = start; p<last; p+=esize)
49 reinterpret_cast<Link*>(p)->next =
reinterpret_cast<Link*
>(p+esize);
50 reinterpret_cast<Link*
>(last)->next = 0;
51 head =
reinterpret_cast<Link*
>(start);