$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r53244 - in sandbox/memory: boost/memory libs/memory/examples/simplest
From: xushiweizh_at_[hidden]
Date: 2009-05-25 04:34:36
Author: xushiwei
Date: 2009-05-25 04:34:34 EDT (Mon, 25 May 2009)
New Revision: 53244
URL: http://svn.boost.org/trac/boost/changeset/53244
Log:
for linux
Added:
   sandbox/memory/libs/memory/examples/simplest/simplest.prj   (contents, props changed)
Text files modified: 
   sandbox/memory/boost/memory/block_pool.hpp  |     4 ++++                                    
   sandbox/memory/boost/memory/object_pool.hpp |     7 ++++---                                 
   sandbox/memory/boost/memory/type_traits.hpp |     4 ++++                                    
   3 files changed, 12 insertions(+), 3 deletions(-)
Modified: sandbox/memory/boost/memory/block_pool.hpp
==============================================================================
--- sandbox/memory/boost/memory/block_pool.hpp	(original)
+++ sandbox/memory/boost/memory/block_pool.hpp	2009-05-25 04:34:34 EDT (Mon, 25 May 2009)
@@ -20,6 +20,10 @@
 #include <climits> // INT_MAX
 #endif
 
+#if !defined(_ALGORITHM_) && !defined(_ALGORITHM)
+#include <algorithm> // std::swap
+#endif
+
 NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
Modified: sandbox/memory/boost/memory/object_pool.hpp
==============================================================================
--- sandbox/memory/boost/memory/object_pool.hpp	(original)
+++ sandbox/memory/boost/memory/object_pool.hpp	2009-05-25 04:34:34 EDT (Mon, 25 May 2009)
@@ -32,6 +32,7 @@
 {
 private:
         typedef fixed_alloc<PolicyT> PoolT;
+	typedef typename PoolT::MemBlock MemBlock;
 
         norm_object_pool_(const norm_object_pool_& o);
         void operator=(const norm_object_pool_& o);
@@ -79,7 +80,7 @@
                 BOOST_MEMORY_STATIC_ASSERT(sizeof(ChunkHeader) == sizeof(typename PoolT::ChunkHeader));
         }
         
-	explicit norm_object_pool_(alloc_type alloc) : PoolT(m_alloc, sizeof(Type))
+	explicit norm_object_pool_(alloc_type alloc) : PoolT(alloc, sizeof(Type))
         {
                 BOOST_MEMORY_STATIC_ASSERT(sizeof(ChunkHeader) == sizeof(typename PoolT::ChunkHeader));
         }
@@ -93,7 +94,7 @@
         static void BOOST_MEMORY_CALL do_clear_block_(MemBlock* const blk, size_t cbChunk)
         {
                 size_t nUsed = blk->nUsed;
-		char* p = blk->buffer + ChunkHeaderSize;
+		char* p = blk->buffer + PoolT::ChunkHeaderSize;
                 for (;; p += cbChunk)
                 {
                         if (is_allocated_(p))
@@ -108,7 +109,7 @@
 public:
         void BOOST_MEMORY_CALL clear()
         {
-		MemBlock* blk = m_blks.first();
+		MemBlock* blk = this->m_blks.first();
 
                 this->m_blks.clear();
                 this->m_freelist.clear();
Modified: sandbox/memory/boost/memory/type_traits.hpp
==============================================================================
--- sandbox/memory/boost/memory/type_traits.hpp	(original)
+++ sandbox/memory/boost/memory/type_traits.hpp	2009-05-25 04:34:34 EDT (Mon, 25 May 2009)
@@ -16,6 +16,10 @@
 #include "basic.hpp"
 #endif
 
+#ifndef _STDLIB_H
+#include <stdlib.h>
+#endif
+
 NS_BOOST_MEMORY_BEGIN
 
 // =========================================================================
Added: sandbox/memory/libs/memory/examples/simplest/simplest.prj
==============================================================================
--- (empty file)
+++ sandbox/memory/libs/memory/examples/simplest/simplest.prj	2009-05-25 04:34:34 EDT (Mon, 25 May 2009)
@@ -0,0 +1,20 @@
+[Include]
+../../../..
+
+[Config Release]
+Product		Exe Release/test
+Options		Release; MultiThread; AnsiChar; NoRtti; Exception; WarningAll
+ObjDir		Release
+LibDir		Release
+Libraries	
+
+[Config Debug]
+Product		Exe Debug/test
+Options		Debug; MultiThread; AnsiChar; NoRtti; Exception; WarningAll
+ObjDir		Debug
+LibDir		Debug
+Libraries	
+
+[Source]
+*.cpp
+