Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85658 - in trunk: boost/container libs/container/doc
From: igaztanaga_at_[hidden]
Date: 2013-09-12 17:50:39


Author: igaztanaga
Date: 2013-09-12 17:50:38 EDT (Thu, 12 Sep 2013)
New Revision: 85658
URL: http://svn.boost.org/trac/boost/changeset/85658

Log:
Fixes #9108

Text files modified:
   trunk/boost/container/vector.hpp | 9 ++++++++-
   trunk/libs/container/doc/container.qbk | 5 +++--
   2 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/boost/container/vector.hpp
==============================================================================
--- trunk/boost/container/vector.hpp Thu Sep 12 13:17:07 2013 (r85657)
+++ trunk/boost/container/vector.hpp 2013-09-12 17:50:38 EDT (Thu, 12 Sep 2013) (r85658)
@@ -1634,7 +1634,11 @@
       const size_type sz = m_holder.m_size;
       ::boost::container::uninitialized_move_alloc_n_source
          ( this->m_holder.alloc(), raw_beg, sz, container_detail::to_raw_pointer(p) );
+ if(this->m_holder.capacity()){
+ if(!value_traits::trivial_dctr_after_move)
       boost::container::destroy_alloc_n(this->m_holder.alloc(), raw_beg, sz);
+ this->m_holder.deallocate(this->m_holder.start(), this->m_holder.capacity());
+ }
       this->m_holder.start(p);
       this->m_holder.capacity(new_cap);
    }
@@ -1677,7 +1681,6 @@
          }
          //New buffer
          else{
- //Backwards (and possibly forward) expansion
             #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
             ++this->num_alloc;
             #endif
@@ -1685,7 +1688,11 @@
             const size_type sz = m_holder.m_size;
             ::boost::container::uninitialized_move_alloc_n_source
                ( this->m_holder.alloc(), raw_beg, sz, container_detail::to_raw_pointer(ret.first) );
+ if(this->m_holder.capacity()){
+ if(!value_traits::trivial_dctr_after_move)
             boost::container::destroy_alloc_n(this->m_holder.alloc(), raw_beg, sz);
+ this->m_holder.deallocate(this->m_holder.start(), this->m_holder.capacity());
+ }
             this->m_holder.start(ret.first);
             this->m_holder.capacity(real_cap);
          }

Modified: trunk/libs/container/doc/container.qbk
==============================================================================
--- trunk/libs/container/doc/container.qbk Thu Sep 12 13:17:07 2013 (r85657)
+++ trunk/libs/container/doc/container.qbk 2013-09-12 17:50:38 EDT (Thu, 12 Sep 2013) (r85658)
@@ -720,8 +720,9 @@
 * Fixed bugs [@https://svn.boost.org/trac/boost/ticket/8269 #8269],
               [@https://svn.boost.org/trac/boost/ticket/8473 #8473],
               [@https://svn.boost.org/trac/boost/ticket/8892 #8892],
- [@https://svn.boost.org/trac/boost/ticket/9064 #9064].
- [@https://svn.boost.org/trac/boost/ticket/9092 #9092].
+ [@https://svn.boost.org/trac/boost/ticket/9064 #9064],
+ [@https://svn.boost.org/trac/boost/ticket/9092 #9092],
+ [@https://svn.boost.org/trac/boost/ticket/9108 #9108].
 
 [endsect]
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk