
Dear list,
I'm using boost::fast_pool_allocator to replace the default allocator in
a map. This works great, but I'm having a bit of trouble freeing the
memory explicitly.
I'd like to call boost::singleton_pool::purge_memory(), but I don't know
how to instantiate the correct version. Is there a way to determine the
size of the chunks the map allocator will require? I have determined by
debugging that the size is 28 bytes, but I imagine that this is
dependent on the particular implementation of map.
Below is a sample program which illustrates the situation. Any guidance
would be very appreciated.
- Finley
////////////////////////////////////////////////////////////////////////
///
#include
::purge_memory() ;
//bool memory_freed = boost::singleton_pool< boost::fast_pool_allocator_tag, 28 >::purge_memory() ; assert( memory_freed ) ; return 0; }