Re: [Boost-bugs] [Boost C++ Libraries] #4960: boost::pool_allocator for vector of vectors exhausts memory

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4960: boost::pool_allocator for vector of vectors exhausts memory
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-17 17:51:14


#4960: boost::pool_allocator for vector of vectors exhausts memory
--------------------------------------+-------------------------------------
  Reporter: mattiasg | Owner: cnewbold
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: pool
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by steven_watanabe):

 I can't reproduce the problem with gcc 4.4.1, or with MSVC 10. I'd guess
 that it has something to do with the standard library implementation of
 vector, though.

 Can you try applying the patch to singleton_pool which I'm about to
 attach,
 run the following variation and save the output? It should produce
 code that you can compile which demonstrates the problem. Check that
 it actually triggers the problem, and attach it.

 {{{
 #include <boost/pool/pool_alloc.hpp>
 #include <vector>
 #include <iostream>

 typedef std::vector<int, boost::pool_allocator<int> > EventVector;
 typedef std::vector<EventVector> IndexVector;

 int main()
 {
   std::cout << "#include <boost/pool/pool_alloc.hpp>\n";
   std::cout << "int main() {\n";
   std::cout << "void* tmp;\n";
   {
     IndexVector iv;
     int limit = 30;
     for (int i = 0; i < limit; ++i)
       iv.push_back(EventVector());
   }
   std::cout << "}\n";
   return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4960#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC