
I'm understanding that it is not allocating unsigned ints and instead creating a node structure wherein uint is a subelement. The nodes are needed because set is internally kept as a tree structure. What I'm not understanding is when is the memory released? and when is the instance of the set destroyed? On Wed, Mar 17, 2010 at 1:27 PM, Kenny Riddile <kfriddile@yahoo.com> wrote:
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users