Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-05-06 10:57:39


Author: xushiwei
Date: 2008-05-06 10:57:38 EDT (Tue, 06 May 2008)
New Revision: 45174
URL: http://svn.boost.org/trac/boost/changeset/45174

Log:
system pool (lock) vs. system pool (lock free)
Binary files modified:
   sandbox/memory/libs/memory/lib/boost-memory.lib
Text files modified:
   sandbox/memory/boost/lockfree/stack.hpp | 2 --
   sandbox/memory/boost/memory/system_pool.hpp | 6 ------
   sandbox/memory/libs/memory/test/test_basic/memory/system_alloc_perform.cpp | 17 ++++++++++++++---
   3 files changed, 14 insertions(+), 11 deletions(-)

Modified: sandbox/memory/boost/lockfree/stack.hpp
==============================================================================
--- sandbox/memory/boost/lockfree/stack.hpp (original)
+++ sandbox/memory/boost/lockfree/stack.hpp 2008-05-06 10:57:38 EDT (Tue, 06 May 2008)
@@ -65,8 +65,6 @@
 
         void BOOST_LOCKFREE_CALL push(node* val)
         {
- BOOST_DETAIL_ASSERT(val->m_prev == NULL);
-
                 node* the_top = m_top;
                 for (;;)
                 {

Modified: sandbox/memory/boost/memory/system_pool.hpp
==============================================================================
--- sandbox/memory/boost/memory/system_pool.hpp (original)
+++ sandbox/memory/boost/memory/system_pool.hpp 2008-05-06 10:57:38 EDT (Tue, 06 May 2008)
@@ -29,8 +29,6 @@
 // -------------------------------------------------------------------------
 // class normal_stack
 
-#if defined(BOOST_MEMORY_NO_LOCKFREE)
-
 class normal_stack
 {
 private:
@@ -61,8 +59,6 @@
 
         void BOOST_LOCKFREE_CALL push(node* val)
         {
- BOOST_DETAIL_ASSERT(val->m_prev == NULL);
-
                 cslock aLock(m_cs);
                 val->m_prev = m_top;
                 m_top = val;
@@ -87,8 +83,6 @@
         }
 };
 
-#endif // defined(BOOST_MEMORY_NO_LOCKFREE)
-
 // -------------------------------------------------------------------------
 // class system_pool_imp
 

Modified: sandbox/memory/libs/memory/lib/boost-memory.lib
==============================================================================
Binary files. No diff available.

Modified: sandbox/memory/libs/memory/test/test_basic/memory/system_alloc_perform.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/test_basic/memory/system_alloc_perform.cpp (original)
+++ sandbox/memory/libs/memory/test/test_basic/memory/system_alloc_perform.cpp 2008-05-06 10:57:38 EDT (Tue, 06 May 2008)
@@ -10,8 +10,14 @@
 // See http://www.boost.org/libs/memory/index.htm for documentation.
 //
 #include <boost/memory.hpp>
+#include <boost/memory/system_pool.hpp>
 #include <boost/detail/performance_counter.hpp>
 
+using namespace NS_BOOST_MEMORY;
+using namespace NS_BOOST_MEMORY;
+
+typedef system_pool_s<NS_BOOST_MEMORY_POLICY::stdlib, normal_stack> system_pool_static;
+
 template <class LogT>
 class TestSystemAlloc
 {
@@ -53,17 +59,22 @@
 
         void test(LogT& log)
         {
- NS_BOOST_MEMORY::system_pool_dyn sysPool;
- NS_BOOST_MEMORY::stdlib_alloc stdLib;
+ system_pool_dyn sysPool;
+ system_pool_static sysPool2;
+ stdlib_alloc stdLib;
 
                 NS_BOOST_DETAIL::null_log nullLog;
                 doTestAlloc(nullLog, sysPool);
+ doTestAlloc(nullLog, sysPool2);
 
                 log.trace("\n===== StdLibAlloc =====\n");
                 doTestAlloc(log, stdLib);
 
- log.trace("\n===== SystemPoolAlloc =====\n");
+ log.trace("\n===== SystemPoolAlloc (LockFree) =====\n");
                 doTestAlloc(log, sysPool);
+
+ log.trace("\n===== SystemPoolAlloc (Lock) =====\n");
+ doTestAlloc(log, sysPool2);
         }
 };
 


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