7 Oct
2008
7 Oct
'08
4:20 p.m.
On Tue, Oct 7, 2008 at 12:58 AM, Ta-Cheng Lin
Hi:
I try fast_pool_allocator and it does not release memory. See the following program Any ideas?
<snip code> Well, this issue has come up before. I can tell you the reason, but I can't remember the solution. The reason is that the singleton instance you are calling release_memory() on is not the singleton the list is using to allocate nodes. Remember that std::list<int> will rebind the allocator to allocate SomeNodeStruct<int> instead of plain ints. As far as I know, there is not a portable way to get the type of "SomeNodeStruct". HTH, --Michael Fawcett