|
Boost Users : |
Subject: [Boost-users] pool allocator based on element type instead of size?
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2009-06-16 23:32:05
I've found myself wanting something similar to
boost::fast_pool_allocator, but with the following syntax for releasing
memory:
using namespace boost;
std::list< T, fast_pool_allocator<T> > myList;
// Note that second template parameter is T, not sizeof(T).
// Basically I guess I just want a pool per type, even if
// two types have the same size.
singleton_pool< fast_pool_allocator_tag, T >::release_memory();
Is there a reason why this isn't doable that I should know about before
I try to implement it? Has something similar already been done (even if
it's from outside the Boost community) so I don't reinvent the wheel?
Thanks,
Kenny Riddile
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net