[SVN r85658]
This commit is contained in:
Ion Gaztañaga
2013-09-12 21:50:38 +00:00
parent 7d69794f7e
commit ed57e6e619
2 changed files with 11 additions and 3 deletions

View File

@@ -720,8 +720,9 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed bugs [@https://svn.boost.org/trac/boost/ticket/8269 #8269], * 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/8473 #8473],
[@https://svn.boost.org/trac/boost/ticket/8892 #8892], [@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/9064 #9064],
[@https://svn.boost.org/trac/boost/ticket/9092 #9092]. [@https://svn.boost.org/trac/boost/ticket/9092 #9092],
[@https://svn.boost.org/trac/boost/ticket/9108 #9108].
[endsect] [endsect]

View File

@@ -1634,7 +1634,11 @@ class vector
const size_type sz = m_holder.m_size; const size_type sz = m_holder.m_size;
::boost::container::uninitialized_move_alloc_n_source ::boost::container::uninitialized_move_alloc_n_source
( this->m_holder.alloc(), raw_beg, sz, container_detail::to_raw_pointer(p) ); ( 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); 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.start(p);
this->m_holder.capacity(new_cap); this->m_holder.capacity(new_cap);
} }
@@ -1677,7 +1681,6 @@ class vector
} }
//New buffer //New buffer
else{ else{
//Backwards (and possibly forward) expansion
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
++this->num_alloc; ++this->num_alloc;
#endif #endif
@@ -1685,7 +1688,11 @@ class vector
const size_type sz = m_holder.m_size; const size_type sz = m_holder.m_size;
::boost::container::uninitialized_move_alloc_n_source ::boost::container::uninitialized_move_alloc_n_source
( this->m_holder.alloc(), raw_beg, sz, container_detail::to_raw_pointer(ret.first) ); ( 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); 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.start(ret.first);
this->m_holder.capacity(real_cap); this->m_holder.capacity(real_cap);
} }