Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84843 - trunk/boost/lockfree
From: tim_at_[hidden]
Date: 2013-06-20 05:28:04


Author: timblechmann
Date: 2013-06-20 05:28:04 EDT (Thu, 20 Jun 2013)
New Revision: 84843
URL: http://svn.boost.org/trac/boost/changeset/84843

Log:
lockfree: spsc_queue - fix allocation

Text files modified:
   trunk/boost/lockfree/spsc_queue.hpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/boost/lockfree/spsc_queue.hpp
==============================================================================
--- trunk/boost/lockfree/spsc_queue.hpp Wed Jun 19 19:12:22 2013 (r84842)
+++ trunk/boost/lockfree/spsc_queue.hpp 2013-06-20 05:28:04 EDT (Thu, 20 Jun 2013) (r84843)
@@ -353,8 +353,8 @@
         max_elements_(max_elements + 1)
     {
         // TODO: we don't necessarily need to construct all elements
- array_ = Alloc::allocate(max_elements);
- for (size_t i = 0; i != max_elements; ++i)
+ array_ = Alloc::allocate(max_elements_);
+ for (size_t i = 0; i != max_elements_; ++i)
             Alloc::construct(array_ + i, T());
     }
 
@@ -372,8 +372,8 @@
         Alloc(alloc), max_elements_(max_elements + 1)
     {
         // TODO: we don't necessarily need to construct all elements
- array_ = Alloc::allocate(max_elements);
- for (size_t i = 0; i != max_elements; ++i)
+ array_ = Alloc::allocate(max_elements_);
+ for (size_t i = 0; i != max_elements_; ++i)
             Alloc::construct(array_ + i, T());
     }
 


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