Original Post
Hi, I've been doing a fair bit of reading about memory management and smart pointers, and would like to ask a few questions of the esteemed audience (smarm, smarm). From what I've read, memory management looks to handle a few issues, such as: fragmentation and coalescing statistic generation - mean, max amount of memory usage allocation auditing - tracking memory blocks and making sure they are freed correctly Smart pointers often seem to be integrated into this structure, in that they handle managing their own associated memory (primarily a way of getting rid of worrying about when to delete them). For example, the Boost::shared_ptr explicitly says in its description : "Every occurence of the new keyword in the code should have the form shared_ptr p(new Y) ... If you follow this guideline, it naturally follows that you will have no explicit deletes..." Most memory manager implementations I have seen rely on over-riding global new/delete (or object-specific new/delete). How easy then is it to implement a custom memory manager when you hand new/delete responsibilities over to a libray like boost (I believe there is a similar issue with some of the IO functions that handle their own memory acquisitions). So - the question boils down to this. How are people integrating these concepts in their own designs? Is there a way of using a library such as Boost with a self-written memory manager? If you want this functionality do you need to write the smart pointers yourself, so as to integrate them with your custom memory manager? Or is there an alternative way to meet these objectives? Thanks in advance for any help, Jim.