int main() { MemoryPool *m = new MemoryPool(4); int *h; int *p=(int*)m->Alloc(); *p = 1; h = p; for (int i = 2; i < 256; i++) { p = (int*)m->Alloc(); *p = i; } for (; h != p; h++) cout << *h << " " << endl; delete m; }
void *CancelableCancelUpdate::operator new(size_t aSize) { return sCancelPool.Alloc(); }
void *Cancelable::operator new(size_t aSize) { return sPool.Alloc(); }
void *TetherBurn::operator new(size_t aSize) { return sTetherBurnPool.Alloc(); }
void *Explosion::operator new(size_t aSize) { return sPool.Alloc(); }
void *Resource::operator new(size_t aSize) { return sPool.Alloc(); }
void *CapturableCaptureUpdate::operator new(size_t aSize) { return sCapturePool.Alloc(); }
void *PickupGrantUpdate::operator new(size_t aSize) { return sKillPool.Alloc(); }
void *Pickup::operator new(size_t aSize) { return sPool.Alloc(); }
void *Renderable::operator new(size_t aSize) { return sPool.Alloc(); }