Boost logo

Boost Users :

Subject: Re: [Boost-users] custom allocators Re:pool_alloc
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2010-03-17 16:27:24


B Hart wrote:
> Sorry, I don't get you...as I understand the pool is a singleton, and
> once out of scope I would assume all the memory for the set is
> released back to the OS.

If you mean when the std::set goes out of scope, then no.

> And then "internal node type"...what is that?

Some STL containers (std::list, std::set, etc.) don't directly store
elements of the type you specify. For example, a std::list would likely
store list nodes that contain the data element itself as well as
pointers to the previous and next nodes. In that case, a std::list<
Foo, boost::pool_allocator<Foo> > doesn't allocate via
boost::singleton_pool<boost::pool_allocator_tag, sizeof(Foo)>. It
allocates via boost::singleton_pool<boost::pool_allocator_tag,
sizeof(SomeUnknownInternalNodeType)>.


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