Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-05-02 04:30:06


Author: xushiwei
Date: 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
New Revision: 45009
URL: http://svn.boost.org/trac/boost/changeset/45009

Log:
issue issue #1879:
1. macros are all prefixed with BOOST_MEMORY to avoid conflicts.
2. everything goes into namespace boost::memory, rather than directly in namespace boost.

Text files modified:
   sandbox/memory/boost/memory.hpp | 42 +++++++++++++++++-
   sandbox/memory/boost/memory/auto_alloc.hpp | 6 +-
   sandbox/memory/boost/memory/basic.hpp | 85 +++++++++++++++++++--------------------
   sandbox/memory/boost/memory/gc_alloc.hpp | 28 ++++++------
   sandbox/memory/boost/memory/policy.hpp | 4
   sandbox/memory/boost/memory/scoped_alloc.hpp | 4
   sandbox/memory/boost/memory/stl/queue.hpp | 11 ++--
   sandbox/memory/boost/memory/system_alloc.hpp | 12 ++--
   sandbox/memory/boost/memory/thread/tls.hpp | 20 ++++----
   sandbox/memory/boost/memory/threadmodel.hpp | 4
   sandbox/memory/boost/memory/threadmodel/multi_thread.hpp | 4
   sandbox/memory/boost/memory/threadmodel/single_thread.hpp | 4
   sandbox/memory/libs/memory/test/memory/simple_examples.cpp | 3
   sandbox/memory/libs/memory/test/memory/stl_containers.cpp | 10 ++-
   14 files changed, 137 insertions(+), 100 deletions(-)

Modified: sandbox/memory/boost/memory.hpp
==============================================================================
--- sandbox/memory/boost/memory.hpp (original)
+++ sandbox/memory/boost/memory.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -14,6 +14,10 @@
 
 // -------------------------------------------------------------------------
 
+#ifndef BOOST_MEMORY_BASIC_HPP
+#include "memory/basic.hpp"
+#endif
+
 #ifndef BOOST_MEMORY_AUTO_ALLOC_HPP
 #include "memory/auto_alloc.hpp"
 #endif
@@ -29,7 +33,7 @@
 // -------------------------------------------------------------------------
 // class stl_allocator
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 template <class Type, class AllocT = scoped_alloc>
 class stl_allocator
@@ -63,7 +67,7 @@
         stl_allocator(AllocT& alloc) : m_alloc(&alloc) {}
 
     template <class U>
- stl_allocator(const stl_allocator<U, AllocT>& rhs) : m_alloc(rhs.inner_GetAlloc()) {}
+ stl_allocator(const stl_allocator<U, AllocT>& o) : m_alloc(o._getAlloc()) {}
 
         pointer allocate(size_type count, const void* = NULL)
                 { return (pointer)m_alloc->allocate(count * sizeof(Type)); }
@@ -78,7 +82,8 @@
         char* _Charalloc(size_type cb)
                 { return (char*)m_alloc->allocate(cb); }
 
- AllocT* inner_GetAlloc() const { return m_alloc; }
+public:
+ AllocT* _getAlloc() const { return m_alloc; }
 };
 
 #if !defined(BOOST_MEMORY_NO_PARTIAL_SPECIAILIZATION)
@@ -144,7 +149,36 @@
     return false;
 }
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
+
+// -------------------------------------------------------------------------
+
+namespace boost
+{
+ namespace memory {}
+
+ using boost::memory::system_alloc;
+
+ using boost::memory::block_pool;
+ using boost::memory::tls_block_pool;
+
+ using boost::memory::auto_alloc;
+ using boost::memory::scoped_alloc;
+ using boost::memory::gc_alloc;
+
+ using boost::memory::stl_allocator;
+
+ using boost::memory::enableMemoryLeakCheck;
+}
+
+#define BOOST_NO_CONSTRUCTOR(Type) BOOST_MEMORY_NO_CONSTRUCTOR(Type)
+#define BOOST_NO_DESTRUCTOR(Type) BOOST_MEMORY_NO_DESTRUCTOR(Type)
+
+#define BOOST_NEW(alloc, Type) BOOST_MEMORY_NEW(alloc, Type)
+#define BOOST_NEW_ARRAY(alloc, Type, count) BOOST_MEMORY_NEW_ARRAY(alloc, Type, count)
+
+#define BOOST_ALLOC(alloc, Type) BOOST_MEMORY_ALLOC(alloc, Type)
+#define BOOST_ALLOC_ARRAY(alloc, Type, count) BOOST_MEMORY_ALLOC_ARRAY(alloc, Type, count)
 
 // -------------------------------------------------------------------------
 // $Log: memory.hpp,v $

Modified: sandbox/memory/boost/memory/auto_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/auto_alloc.hpp (original)
+++ sandbox/memory/boost/memory/auto_alloc.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -20,7 +20,7 @@
 #include "policy.hpp"
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class region_alloc
@@ -203,7 +203,7 @@
                 // no action
         }
 
- BOOST_FAKE_DBG_ALLOCATE_();
+ BOOST_MEMORY_FAKE_DBG_ALLOCATE_();
 };
 
 // -------------------------------------------------------------------------
@@ -214,6 +214,6 @@
 // -------------------------------------------------------------------------
 // $Log: auto_alloc.hpp,v $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_AUTO_ALLOC_HPP */

Modified: sandbox/memory/boost/memory/basic.hpp
==============================================================================
--- sandbox/memory/boost/memory/basic.hpp (original)
+++ sandbox/memory/boost/memory/basic.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -42,9 +42,10 @@
 
 // -------------------------------------------------------------------------
 
-#ifndef NS_BOOST_BEGIN
-#define NS_BOOST_BEGIN namespace boost {
-#define NS_BOOST_END }
+#ifndef NS_BOOST_MEMORY_BEGIN
+#define NS_BOOST_MEMORY_BEGIN namespace boost { namespace memory {
+#define NS_BOOST_MEMORY_END } }
+#define NS_BOOST_MEMORY boost::memory
 #endif
 
 // -------------------------------------------------------------------------
@@ -93,7 +94,7 @@
 // =========================================================================
 // constructor_traits, destructor_traits
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 typedef void BOOST_MEMORY_CALL BOOST_FnDestructor(void* data);
 typedef BOOST_FnDestructor* destructor_t;
@@ -172,13 +173,13 @@
         destructor_traits<Type>::destructArrayN(array, count);
 }
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // =========================================================================
-// BOOST_NO_DESTRUCTOR
+// BOOST_MEMORY_NO_DESTRUCTOR
 
-#define BOOST_NO_DESTRUCTOR(Type) \
-NS_BOOST_BEGIN \
+#define BOOST_MEMORY_NO_DESTRUCTOR(Type) \
+NS_BOOST_MEMORY_BEGIN \
 template <> \
 struct destructor_traits< Type > \
 { \
@@ -207,13 +208,13 @@
                 return 0; \
         } \
 }; \
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // -------------------------------------------------------------------------
-// BOOST_NO_CONSTRUCTOR
+// BOOST_MEMORY_NO_CONSTRUCTOR
 
-#define BOOST_NO_CONSTRUCTOR(Type) \
-NS_BOOST_BEGIN \
+#define BOOST_MEMORY_NO_CONSTRUCTOR(Type) \
+NS_BOOST_MEMORY_BEGIN \
 template <> \
 struct constructor_traits< Type > \
 { \
@@ -224,61 +225,59 @@
                 return array; \
         } \
 }; \
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // -------------------------------------------------------------------------
 // C Standard Types Support
 
-#define BOOST_DECL_CTYPE(Type) \
- BOOST_NO_CONSTRUCTOR(Type); \
- BOOST_NO_DESTRUCTOR(Type)
+#define BOOST_MEMORY_DECL_CTYPE(Type) \
+ BOOST_MEMORY_NO_CONSTRUCTOR(Type); \
+ BOOST_MEMORY_NO_DESTRUCTOR(Type)
 
-BOOST_DECL_CTYPE(bool);
-BOOST_DECL_CTYPE(float);
-BOOST_DECL_CTYPE(double);
+BOOST_MEMORY_DECL_CTYPE(bool);
+BOOST_MEMORY_DECL_CTYPE(float);
+BOOST_MEMORY_DECL_CTYPE(double);
 
-BOOST_DECL_CTYPE(int);
-BOOST_DECL_CTYPE(unsigned int);
+BOOST_MEMORY_DECL_CTYPE(int);
+BOOST_MEMORY_DECL_CTYPE(unsigned int);
 
-BOOST_DECL_CTYPE(char);
-BOOST_DECL_CTYPE(unsigned char);
+BOOST_MEMORY_DECL_CTYPE(char);
+BOOST_MEMORY_DECL_CTYPE(unsigned char);
 
-BOOST_DECL_CTYPE(short);
-BOOST_DECL_CTYPE(unsigned short);
+BOOST_MEMORY_DECL_CTYPE(short);
+BOOST_MEMORY_DECL_CTYPE(unsigned short);
 
-BOOST_DECL_CTYPE(long);
-BOOST_DECL_CTYPE(unsigned long);
+BOOST_MEMORY_DECL_CTYPE(long);
+BOOST_MEMORY_DECL_CTYPE(unsigned long);
 
 // =========================================================================
-// MEMORY_DBG_NEW_ARG
+// BOOST_MEMORY_DBG_NEW_ARG
 
 #if defined(_DEBUG)
-#define MEMORY_FILE_LINE_ARG ,__FILE__, __LINE__
+#define BOOST_MEMORY_FILE_LINE_ARG , __FILE__, __LINE__
 #else
-#define MEMORY_FILE_LINE_ARG
+#define BOOST_MEMORY_FILE_LINE_ARG
 #endif
 
-#define MEMORY_NEW_ARG(Type) sizeof(Type), boost::destructor_traits<Type>::destruct
-#define MEMORY_DBG_NEW_ARG(Type) MEMORY_NEW_ARG(Type) MEMORY_FILE_LINE_ARG
+#define BOOST_MEMORY_NEW_ARG(Type) sizeof(Type), NS_BOOST_MEMORY::destructor_traits<Type>::destruct
+#define BOOST_MEMORY_DBG_NEW_ARG(Type) BOOST_MEMORY_NEW_ARG(Type) BOOST_MEMORY_FILE_LINE_ARG
 
-#define MEMORY_NEW_ARRAY_ARG(Type, count) (count), (Type*)0
-#define MEMORY_DBG_NEW_ARRAY_ARG(Type, count) MEMORY_NEW_ARRAY_ARG(Type, count) MEMORY_FILE_LINE_ARG
-
-#define MEMORY_DBG_ALLOC_ARG(Type) sizeof(Type) MEMORY_FILE_LINE_ARG
-#define MEMORY_DBG_ALLOC_ARRAY_ARG(Type, count) sizeof(Type)*(count) MEMORY_FILE_LINE_ARG
+#define BOOST_MEMORY_DBG_NEW_ARRAY_ARG(Type, count) (count), (Type*)0 BOOST_MEMORY_FILE_LINE_ARG
+#define BOOST_MEMORY_DBG_ALLOC_ARG(Type) sizeof(Type) BOOST_MEMORY_FILE_LINE_ARG
+#define BOOST_MEMORY_DBG_ALLOC_ARRAY_ARG(Type, count) sizeof(Type)*(count) BOOST_MEMORY_FILE_LINE_ARG
 
 // =========================================================================
 // NEW, NEW_ARRAY, ALLOC, ALLOC_ARRAY
 
-#define BOOST_NEW(alloc, Type) ::new((alloc).allocate(MEMORY_DBG_NEW_ARG(Type))) Type
-#define BOOST_NEW_ARRAY(alloc, Type, count) (alloc).newArray(MEMORY_DBG_NEW_ARRAY_ARG(Type, count))
+#define BOOST_MEMORY_NEW(alloc, Type) ::new((alloc).allocate(BOOST_MEMORY_DBG_NEW_ARG(Type))) Type
+#define BOOST_MEMORY_NEW_ARRAY(alloc, Type, count) (alloc).newArray(BOOST_MEMORY_DBG_NEW_ARRAY_ARG(Type, count))
 
-#define BOOST_ALLOC(alloc, Type) ((Type*)(alloc).allocate(MEMORY_DBG_ALLOC_ARG(Type)))
-#define BOOST_ALLOC_ARRAY(alloc, Type, count) ((Type*)(alloc).allocate(MEMORY_DBG_ALLOC_ARRAY_ARG(Type, count)))
+#define BOOST_MEMORY_ALLOC(alloc, Type) ((Type*)(alloc).allocate(BOOST_MEMORY_DBG_ALLOC_ARG(Type)))
+#define BOOST_MEMORY_ALLOC_ARRAY(alloc, Type, count) ((Type*)(alloc).allocate(BOOST_MEMORY_DBG_ALLOC_ARRAY_ARG(Type, count)))
 
 // =========================================================================
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 inline void BOOST_MEMORY_CALL enableMemoryLeakCheck()
 {
@@ -287,7 +286,7 @@
 #endif
 }
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // =========================================================================
 // $Log: basic.hpp,v $

Modified: sandbox/memory/boost/memory/gc_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/gc_alloc.hpp (original)
+++ sandbox/memory/boost/memory/gc_alloc.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -19,14 +19,14 @@
 #endif
 
 #ifndef BOOST_MEMORY_STL_QUEUE_HPP
-#include "stl/queue.hpp" // boost::priority_queue
+#include "stl/queue.hpp" // NS_BOOST_MEMORY::priority_queue
 #endif
 
 #if !defined(_DEQUE_) && !defined(_DEQUE)
 #include <deque> // std::deque
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class gen_alloc
@@ -145,7 +145,7 @@
                 }
         };
         typedef std::deque<FreeMemHeader*> Container;
- typedef boost::priority_queue<FreeMemHeader*, Container, Pred> PriorityQ;
+ typedef NS_BOOST_MEMORY::priority_queue<FreeMemHeader*, Container, Pred> PriorityQ;
         
         char* m_begin;
         char* m_end;
@@ -160,12 +160,12 @@
 private:
         enum { HeaderSize = sizeof(void*) };
         enum { BlockSize = MemBlockSize - HeaderSize };
- enum { _AllocSizeBigDef = MAX(PolicyT::AllocSizeBig, BlockSize/4) };
- enum { _AllocSizeHugeDef = MAX(PolicyT::AllocSizeHuge, 64*1024) };
- enum { _GCLimitSizeDef = MAX(PolicyT::GCLimitSizeDef, 64*1024) };
- enum { AllocSizeBig = MIN(_AllocSizeBigDef, BlockSize/2) };
- enum { AllocSizeHuge = MIN(_AllocSizeHugeDef, (1 << 29)) };
- enum { GCLimitSizeDef = MIN(_GCLimitSizeDef, (1 << 29)) };
+ enum { AllocSizeBigDef_ = MAX(PolicyT::AllocSizeBig, BlockSize/4) };
+ enum { AllocSizeHugeDef_ = MAX(PolicyT::AllocSizeHuge, 64*1024) };
+ enum { GCLimitSizeDef_ = MAX(PolicyT::GCLimitSizeDef, 64*1024) };
+ enum { AllocSizeBig = MIN(AllocSizeBigDef_, BlockSize/2) };
+ enum { AllocSizeHuge = MIN(AllocSizeHugeDef_, (1 << 29)) };
+ enum { GCLimitSizeDef = MIN(GCLimitSizeDef_, (1 << 29)) };
         enum { RecycleSizeMin = MAX(PolicyT::RecycleSizeMin, 128) };
 
 private:
@@ -382,11 +382,11 @@
                         MemHeader* pNew;
                         if (cb >= AllocSizeBig)
                         {
- if (cbData >= AllocSizeHuge)
- return m_hugeAlloc.allocate(cbData);
-
                                 if (cb >= BlockSize)
                                 {
+ if (cbData >= AllocSizeHuge)
+ return m_hugeAlloc.allocate(cbData);
+
                                         pNew = _newBlock(cb + HeaderSize);
                                         pNew->blkType = nodeAlloced;
                                         return pNew + 1;
@@ -528,7 +528,7 @@
                 }
         }
 
- BOOST_FAKE_DBG_ALLOCATE_();
+ BOOST_MEMORY_FAKE_DBG_ALLOCATE_();
 };
 
 template <class PolicyT>
@@ -542,6 +542,6 @@
 // -------------------------------------------------------------------------
 // $Log: gc_alloc.hpp,v $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_GC_ALLOC_HPP */

Modified: sandbox/memory/boost/memory/policy.hpp
==============================================================================
--- sandbox/memory/boost/memory/policy.hpp (original)
+++ sandbox/memory/boost/memory/policy.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -16,7 +16,7 @@
 #include "system_alloc.hpp"
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class simple_gc_alloc
@@ -141,6 +141,6 @@
 // -------------------------------------------------------------------------
 // $Log: policy.hpp,v $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_POLICY_HPP */

Modified: sandbox/memory/boost/memory/scoped_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/scoped_alloc.hpp (original)
+++ sandbox/memory/boost/memory/scoped_alloc.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -28,7 +28,7 @@
 #include <climits> // INT_MAX
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class proxy_alloc
@@ -191,6 +191,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_SCOPED_ALLOC_HPP */

Modified: sandbox/memory/boost/memory/stl/queue.hpp
==============================================================================
--- sandbox/memory/boost/memory/stl/queue.hpp (original)
+++ sandbox/memory/boost/memory/stl/queue.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -24,12 +24,13 @@
 #include <algorithm> // std::make_heap, etc
 #endif
 
-#ifndef NS_BOOST_BEGIN
-#define NS_BOOST_BEGIN namespace boost {
-#define NS_BOOST_END }
+#ifndef NS_BOOST_MEMORY_BEGIN
+#define NS_BOOST_MEMORY_BEGIN namespace boost { namespace memory {
+#define NS_BOOST_MEMORY_END } }
+#define NS_BOOST_MEMORY boost::memory
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 
@@ -99,6 +100,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_STL_QUEUE_HPP */

Modified: sandbox/memory/boost/memory/system_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/system_alloc.hpp (original)
+++ sandbox/memory/boost/memory/system_alloc.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -28,14 +28,14 @@
 #include <cstdlib> // malloc, free
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
-// BOOST_FAKE_DBG_ALLOCATE_
+// BOOST_MEMORY_FAKE_DBG_ALLOCATE_
 
 #if defined(_DEBUG)
 
-#define BOOST_FAKE_DBG_ALLOCATE_() \
+#define BOOST_MEMORY_FAKE_DBG_ALLOCATE_() \
         void* BOOST_MEMORY_CALL allocate(size_t cb, LPCSTR szFile, int nLine) \
                 { return allocate(cb); } \
         void* BOOST_MEMORY_CALL allocate(size_t cb, destructor_t fn, LPCSTR szFile, int nLine) \
@@ -50,7 +50,7 @@
 
 #else
 
-#define BOOST_FAKE_DBG_ALLOCATE_()
+#define BOOST_MEMORY_FAKE_DBG_ALLOCATE_()
 
 #endif
 
@@ -122,7 +122,7 @@
                 return constructor_traits<Type>::constructArray(array, count);
         }
 #else
- BOOST_FAKE_DBG_ALLOCATE_()
+ BOOST_MEMORY_FAKE_DBG_ALLOCATE_()
 #endif
 };
 
@@ -134,6 +134,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_SYSTEM_ALLOC_HPP */

Modified: sandbox/memory/boost/memory/thread/tls.hpp
==============================================================================
--- sandbox/memory/boost/memory/thread/tls.hpp (original)
+++ sandbox/memory/boost/memory/thread/tls.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -25,7 +25,7 @@
 
 #if defined(_WIN32)
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 typedef DWORD TLSINDEX;
 
@@ -56,7 +56,7 @@
         }
 };
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif // defined(_WIN32)
 
@@ -69,7 +69,7 @@
 #include <pthread.h>
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 class pthread_tls_key
 {
@@ -98,14 +98,14 @@
         }
 };
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif // !defined(_WIN32)
 
 // -------------------------------------------------------------------------
 // class tls_key
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 #if defined(_WIN32)
 
@@ -117,12 +117,12 @@
 
 #endif
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // -------------------------------------------------------------------------
 // class tls_ptr
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 template <class Type>
 class tls_ptr
@@ -163,12 +163,12 @@
         }
 };
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // -------------------------------------------------------------------------
 // class tls_object
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 template <class Type>
 class tls_factory
@@ -238,7 +238,7 @@
         }
 };
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 // -------------------------------------------------------------------------
 // $Log: $

Modified: sandbox/memory/boost/memory/threadmodel.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -22,7 +22,7 @@
 #include "threadmodel/multi_thread.hpp"
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class auto_lock
@@ -90,6 +90,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_THREADMODEL_HPP */

Modified: sandbox/memory/boost/memory/threadmodel/multi_thread.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel/multi_thread.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel/multi_thread.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -20,7 +20,7 @@
 #include "../winapi/winbase.h"
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // class refcount_mt
@@ -92,6 +92,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H */

Modified: sandbox/memory/boost/memory/threadmodel/single_thread.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel/single_thread.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel/single_thread.hpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -16,7 +16,7 @@
 #include "../basic.hpp"
 #endif
 
-NS_BOOST_BEGIN
+NS_BOOST_MEMORY_BEGIN
 
 // -------------------------------------------------------------------------
 // struct refcount_st
@@ -56,6 +56,6 @@
 // -------------------------------------------------------------------------
 // $Log: $
 
-NS_BOOST_END
+NS_BOOST_MEMORY_END
 
 #endif /* BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H */

Modified: sandbox/memory/libs/memory/test/memory/simple_examples.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/memory/simple_examples.cpp (original)
+++ sandbox/memory/libs/memory/test/memory/simple_examples.cpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -68,7 +68,8 @@
         int* intBuf = BOOST_ALLOC(alloc, int);
         int* intArrayBuf = BOOST_ALLOC_ARRAY(alloc, int, 100);
 
- char* hugeBuf = BOOST_NEW_ARRAY(alloc, char, boost::policy::sys::AllocSizeHuge); // > HugeSize
+ enum { AllocSizeHuge = boost::memory::policy::sys::AllocSizeHuge };
+ char* hugeBuf = BOOST_NEW_ARRAY(alloc, char, AllocSizeHuge); // > HugeSize
         
         boost::gc_alloc* suballoc = BOOST_NEW(alloc, boost::gc_alloc);
         int* e = BOOST_NEW(*suballoc, int);

Modified: sandbox/memory/libs/memory/test/memory/stl_containers.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/memory/stl_containers.cpp (original)
+++ sandbox/memory/libs/memory/test/memory/stl_containers.cpp 2008-05-02 04:30:04 EDT (Fri, 02 May 2008)
@@ -18,6 +18,8 @@
 #include <deque>
 #include <cstdio>
 
+using boost::stl_allocator;
+
 // -------------------------------------------------------------------------
 
 enum { Count = 1000000 };
@@ -26,7 +28,7 @@
 {
         printf("\n===== Deque (scoped_alloc) =====\n");
         boost::scoped_alloc alloc;
- std::deque<int, boost::stl_allocator<int> > s(alloc);
+ std::deque<int, stl_allocator<int> > s(alloc);
         for (int i = 0; i < Count; ++i)
                 s.push_back(i);
 }
@@ -35,7 +37,7 @@
 {
         printf("\n===== List (scoped_alloc) =====\n");
         boost::scoped_alloc alloc;
- std::list<int, boost::stl_allocator<int> > s(alloc);
+ std::list<int, stl_allocator<int> > s(alloc);
         for (int i = 0; i < Count; ++i)
                 s.push_back(i);
 }
@@ -44,7 +46,7 @@
 {
         printf("\n===== Set (scoped_alloc) =====\n");
         boost::scoped_alloc alloc;
- std::set<int, std::less<int>, boost::stl_allocator<int> > s(std::less<int>(), alloc);
+ std::set<int, std::less<int>, stl_allocator<int> > s(std::less<int>(), alloc);
         for (int i = 0; i < Count; ++i)
                 s.insert(i);
 }
@@ -53,7 +55,7 @@
 {
         printf("\n===== Map (scoped_alloc) =====\n");
         boost::scoped_alloc alloc;
- std::map<int, int, std::less<int>, boost::stl_allocator<int> > s(std::less<int>(), alloc);
+ std::map<int, int, std::less<int>, stl_allocator<int> > s(std::less<int>(), alloc);
         for (int i = 0; i < Count; ++i)
                 s.insert(std::pair<int, int>(i, i));
 }


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