Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84454 - in branches/release: boost/lockfree libs/lockfree libs/lockfree/test
From: tim_at_[hidden]
Date: 2013-05-24 02:39:10


Author: timblechmann
Date: 2013-05-24 02:39:07 EDT (Fri, 24 May 2013)
New Revision: 84454
URL: http://svn.boost.org/trac/boost/changeset/84454

Log:
lockfree: merge fixes from trunk

Properties modified:
   branches/release/boost/lockfree/ (props changed)
   branches/release/libs/lockfree/ (props changed)
Text files modified:
   branches/release/boost/lockfree/stack.hpp | 4 ++--
   branches/release/libs/lockfree/test/queue_test.cpp | 9 +++++++++
   branches/release/libs/lockfree/test/stack_test.cpp | 10 ++++++++++
   3 files changed, 21 insertions(+), 2 deletions(-)

Modified: branches/release/boost/lockfree/stack.hpp
==============================================================================
--- branches/release/boost/lockfree/stack.hpp (original)
+++ branches/release/boost/lockfree/stack.hpp 2013-05-24 02:39:07 EDT (Fri, 24 May 2013)
@@ -189,7 +189,7 @@
     void reserve(size_type n)
     {
         BOOST_STATIC_ASSERT(!has_capacity);
- pool.reserve(n);
+ pool.template reserve<true>(n);
     }
 
     /** Allocate n nodes for freelist
@@ -201,7 +201,7 @@
     void reserve_unsafe(size_type n)
     {
         BOOST_STATIC_ASSERT(!has_capacity);
- pool.reserve_unsafe(n);
+ pool.template reserve<false>(n);
     }
 
     /** Destroys stack, free all nodes from freelist.

Modified: branches/release/libs/lockfree/test/queue_test.cpp
==============================================================================
--- branches/release/libs/lockfree/test/queue_test.cpp (original)
+++ branches/release/libs/lockfree/test/queue_test.cpp 2013-05-24 02:39:07 EDT (Fri, 24 May 2013)
@@ -177,3 +177,12 @@
 
     BOOST_REQUIRE(f.empty());
 }
+
+BOOST_AUTO_TEST_CASE( reserve_test )
+{
+ typedef boost::lockfree::queue< void* > memory_queue;
+
+ memory_queue ms(1);
+ ms.reserve(1);
+ ms.reserve_unsafe(1);
+}

Modified: branches/release/libs/lockfree/test/stack_test.cpp
==============================================================================
--- branches/release/libs/lockfree/test/stack_test.cpp (original)
+++ branches/release/libs/lockfree/test/stack_test.cpp 2013-05-24 02:39:07 EDT (Fri, 24 May 2013)
@@ -160,3 +160,13 @@
 
     BOOST_REQUIRE(f.empty());
 }
+
+
+BOOST_AUTO_TEST_CASE( reserve_test )
+{
+ typedef boost::lockfree::stack< void* > memory_stack;
+
+ memory_stack ms(1);
+ ms.reserve(1);
+ ms.reserve_unsafe(1);
+}


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