If you are trying to avoid allocation time while running you could:
1) at startup create a lot of objects and put their addresses in a linked list.
Then as you neeed objects, get trhe address of one from th list. When you delete an object do so by putting its address back into the list. Delete the list when the program finishes. If the list ever gets exhausted, then allocate new objects individually. When these objects enter the destructor the
this pointer can be added to the list.
2) create a private heap using placement new. Allocate from your heap as you would in (1) above but when you finish the program, just delete the private heap. Now you don't need to free your objects. If you are using Windows then about CreateProcessHeap.
3) create your objects as needed but do on a worker thread. Check back later to get the address from that thread.
Note than in C++ you can override std::operator new. If you are using option (1) here's where you work with your linked list.
pool_alloc is a Boost whiz bang that you can use as an STL allocator with the STL first class containeers, like vector and list.
What I am talking about is pre-allocation. That is, allocate at the outset enough objects so that you don't need to allocate them individaully later.
My linked list would be in a Singleton and would be pre-loaded in the Singleton constructor. That way the list would be guaranteed to exist before main() started. Creating the linked list in main() is too late as global objects may need the list before main() starts.
Lastly, do not use your pointers directly, Use aa handle object. Read this:
http://bytes.com/topic/c/insights/65...-smart-pointer