boost pool_alloc

Posted by mr grumpy on Stack Overflow See other posts from Stack Overflow or by mr grumpy
Published on 2010-03-31T00:23:35Z Indexed on 2010/03/31 0:33 UTC
Read the original article Hit count: 438

Filed under:
|
|
|

Why is the boost::fast_pool_allocator built on top of a singleton pool, and not a separate pool per allocator instance? Or to put it another way, why only provide that, and not the option of having a pool per allocator? Would having that be a bad idea?

I have a class that internally uses about 10 different boost::unordered_map types. If I'd used the std::allocator then all the memory would go back to the system when it called delete, whereas now I have to call release_memory on many different allocator types at some point. Would I be stupid to roll my own allocator that uses pool instead of singleton_pool?

thanks

© Stack Overflow or respective owner

Related posts about boost

Related posts about pool