|
From: Robert W. <rj...@du...> - 2004-01-10 07:56:54
|
Hi all, I've made an experimental patch for the CVS head to support memory pool-based custom allocators. These are allocators that malloc or mmap one or more large pools of memory and parcel it out in small chunks.=20 The main motivation for adding this was to allow all memory in a particular pool to be freed in one go. This is pretty difficult to do with the existing custom allocator support, but is fairly popular with the memory pool mechanisms I've seen. This is still work in progress, so there's a few missing pieces. For a start, chunks allocated in a pool do not get leak checked yet. Also, I haven't tested the individual chunk free mechanism very much (as opposed to the "free an entire pool" mechanism, which I have tested.) It has support for red-zones, too, but I haven't tested these at all either. You can find it here: http://www.durables.org/software/valgrind You can see an example of it being used in the test-case I created for it: memcheck/tests/mempool.c Please send me feedback or drop me a mail if you have any questions about how to use it. The motivation for creating this was a pool-based allocator in some software I work on at my job, so it may be skewed towards assumptions I made based on that. If there's other pool-based mechanisms that this doesn't appear to support, please let me know. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |