NaN, just allow the programmer to specify an existing memory area to place object. This will allow the flexiblity of both options. Of course, the programmer will be responsible for freeing their own memory. So, you'd have to have a flag of some sort to let you know if you should free this object memory or not.

Now create a pool object to allocate/free objects in groups of objects. Okay, it's not as easy as it sounds. ;)
Posted on 2002-02-06 12:37:40 by bitRAKE
Ya... Im 99% sure the code is optomal, as the linked list a pretty bare-bones type structure. memory is filled with link objects, each holding an address to data.

However, I havent tested this yet, but i also wonder if i "allign" the classes to minimal blocks, say 8 DWORDs as a min, then 16, 32 64 etc... Ignoring the excess reserved memory/instance.
I think the heap already alligns its data blocks, but thought this "test" would be simpler than devising a management engine..

Posted on 2002-02-06 22:44:13 by NaN
You could set up your new code (I'm using C++ terms here) to specify a class-specific allocator, with the default being HeapAlloc. You would want the allocator to ensure that a matching "free" procedure is called on destruction.
Posted on 2002-02-08 20:38:27 by tank