Boost logo

Boost Users :

Subject: [Boost-users] custom allocators, pool_alloc, more questions
From: B Hart (bhartsb_at_[hidden])
Date: 2010-03-17 22:30:30


I asked for explanation about custom allocators, but unfortunately the
answers I got led to more questions which didn't get answered.

Supposing a code block:

                        {
                           std::set<unsigned int, std::less<unsigned
int>, boost::pool_allocator<unsigned int>> v;
                           const int K = 10485750;
                        
                           for(int i=0; i<K; i++)
                           {
                                   v.insert(i);
                           }
                        
                        }
//Does memory get released automatically here? or after the line:
                       boost::singleton_pool<boost::pool_allocator_tag,
sizeof(unsigned int)>::release_memory();
                
//what is release_memory() doing besides just setting the node type to
a default? Why does that matter?

Last, is the life of the singleton instance for the duration of
program execution, or just the codeblock?


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