36 unsigned int pre_alloc) :
37 esize(elem_size < sizeof(
Link) ? sizeof(
Link) : elem_size),
39 csize(esize*
n+sizeof(
Chunk)),
46 for (
unsigned int i=0; i<pre_alloc; i++)
57 operator delete((
void*) p);
77 Link *p = static_cast<Link*>(b);
86 void *p =
operator new(csize);
87 Chunk *
c = static_cast<Chunk*>(p);
88 c->mem = static_cast<char*>(p)+
sizeof(
Chunk);
95 char *last = &start[(
n-1)*esize];
97 for (
char *q = start; q<last; q += esize)
98 reinterpret_cast<Link*>(q)->next = reinterpret_cast<Link*>(q+esize);
99 reinterpret_cast<Link*>(last)->next = NULL;
100 head = reinterpret_cast<Link*>(start);