[Boost-bugs] [Boost C++ Libraries] #4603: circular_buffer_space_optimized does not grow when capacity runs out

Subject: [Boost-bugs] [Boost C++ Libraries] #4603: circular_buffer_space_optimized does not grow when capacity runs out
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-27 20:57:18


#4603: circular_buffer_space_optimized does not grow when capacity runs out
---------------------------------------+------------------------------------
 Reporter: daniel.amthauer@… | Owner: jano_gaspar
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: circular_buffer
  Version: Boost 1.43.0 | Severity: Problem
 Keywords: |
---------------------------------------+------------------------------------
 Contrary to what the documentation specifies,
 circular_buffer_space_optimized does not grow when capacity runs out.

 The problem seems to be in line 1243 of space_optimized.hpp:

 {{{
 #!cpp
 1239 //! Ensure the reserve for possible growth up.
 1240 size_type ensure_reserve(size_type new_capacity, size_type
 buffer_size) const {
 1241 if (buffer_size + new_capacity / 5 >= new_capacity)
 1242 new_capacity *= 2; // ensure at least 20% reserve
                 /// shouldn't this be less-than?
 1243 if (new_capacity > m_capacity_ctrl)
 1244 return m_capacity_ctrl;
 1245 return new_capacity;
 1246 }
 }}}

 I've tested changing the "greater-than" sign on line 1243 to a "less-than"
 and that works fine.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4603>
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:04 UTC