Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53186 - in sandbox/memory: boost boost/detail boost/memory boost/memory/thread libs/memory/bin libs/memory/build libs/memory/examples/simplest libs/memory/examples/stl_containers libs/memory/lib libs/memory/test
From: xushiweizh_at_[hidden]
Date: 2009-05-22 15:27:17


Author: xushiwei
Date: 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
New Revision: 53186
URL: http://svn.boost.org/trac/boost/changeset/53186

Log:
important:
1. remove boost-detail (debug.hpp, winbase.hpp, log.hpp, performance_counter.hpp, posix/time.hpp, threadmodel.hpp, etc)
2. remove tls object, pthread
3. remove boost-memory.dll
4. remove test
Removed:
   sandbox/memory/boost/detail/
   sandbox/memory/boost/memory/linklib.hpp
   sandbox/memory/boost/memory/thread/
   sandbox/memory/libs/memory/bin/
   sandbox/memory/libs/memory/build/
   sandbox/memory/libs/memory/lib/
   sandbox/memory/libs/memory/test/
Text files modified:
   sandbox/memory/boost/memory.hpp | 14 --------
   sandbox/memory/boost/memory/basic.hpp | 64 ++++++++++++++++++++++++---------------
   sandbox/memory/boost/memory/block_pool.hpp | 48 +----------------------------
   sandbox/memory/libs/memory/examples/simplest/simple_examples.cpp | 18 -----------
   sandbox/memory/libs/memory/examples/stl_containers/stl_containers.cpp | 13 +++++---
   5 files changed, 49 insertions(+), 108 deletions(-)

Modified: sandbox/memory/boost/memory.hpp
==============================================================================
--- sandbox/memory/boost/memory.hpp (original)
+++ sandbox/memory/boost/memory.hpp 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
@@ -14,20 +14,6 @@
 
 // -------------------------------------------------------------------------
 
-#ifndef BOOST_DETAIL_DEBUG_HPP
-#include "detail/debug.hpp"
-#endif
-
-#ifndef BOOST_DETAIL_WINAPI_WINBASE_H
-#include "detail/winapi/winbase.h"
-#endif
-
-#ifndef BOOST_DETAIL_THREADMODEL_HPP
-#include "detail/threadmodel.hpp"
-#endif
-
-// -------------------------------------------------------------------------
-
 #ifndef BOOST_MEMORY_BASIC_HPP
 #include "memory/basic.hpp"
 #endif

Modified: sandbox/memory/boost/memory/basic.hpp
==============================================================================
--- sandbox/memory/boost/memory/basic.hpp (original)
+++ sandbox/memory/boost/memory/basic.hpp 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
@@ -12,23 +12,7 @@
 #ifndef BOOST_MEMORY_BASIC_HPP
 #define BOOST_MEMORY_BASIC_HPP
 
-// -------------------------------------------------------------------------
-
-#if !defined(_NEW_) && !defined(_NEW)
-#include <new> // new
-#endif
-
-#if !defined(_CSTDIO_) && !defined(_CSTDIO)
-#include <cstdio>
-#endif
-
-#if !defined(_INC_MALLOC) && !defined(_MALLOC_H)
-#include <malloc.h> // _alloca
-#endif
-
-#ifndef BOOST_DETAIL_DEBUG_HPP
-#include <boost/detail/debug.hpp>
-#endif
+// =========================================================================
 
 #pragma pack() // default pack
 #if defined(_MSC_VER)
@@ -36,31 +20,49 @@
 #endif
 // warning: identifier was truncated to '255' characters in the debug information
 
-// =========================================================================
-
 #ifndef BOOST_MEMORY_CALL
 #define BOOST_MEMORY_CALL
 #endif
 
-// -------------------------------------------------------------------------
-
 #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
 
-// -------------------------------------------------------------------------
+// =========================================================================
+// BOOST_MEMORY_ASSERT - diagnost
+
+#if defined(_MSC_VER) && !defined(_INC_CRTDBG)
+#include <crtdbg.h> // _CrtSetDbgFlag, _ASSERTE
+#endif
 
 #ifndef BOOST_MEMORY_ASSERT
-#define BOOST_MEMORY_ASSERT(e) BOOST_DETAIL_ASSERT(e)
+ #if defined(ASSERT)
+ #define BOOST_MEMORY_ASSERT(e) ASSERT(e)
+ #elif defined(_ASSERTE)
+ #define BOOST_MEMORY_ASSERT(e) _ASSERTE(e)
+ #elif defined(BOOST_ASSERT)
+ #define BOOST_MEMORY_ASSERT(e) BOOST_ASSERT(e)
+ #else
+ #ifdef _DEBUG
+ #ifndef assert
+ #include <cassert>
+ #endif
+ #define BOOST_MEMORY_ASSERT(e) assert(e)
+ #else
+ #define BOOST_MEMORY_ASSERT(e)
+ #endif
+ #endif
 #endif
 
+// -------------------------------------------------------------------------
+
 #ifndef BOOST_MEMORY_STATIC_ASSERT
 #if defined(BOOST_STATIC_ASSERT)
 #define BOOST_MEMORY_STATIC_ASSERT(e) BOOST_STATIC_ASSERT(e)
 #else
-#define BOOST_MEMORY_STATIC_ASSERT(e) BOOST_DETAIL_ASSERT(e)
+#define BOOST_MEMORY_STATIC_ASSERT(e) BOOST_MEMORY_ASSERT(e)
 #endif
 #endif
 
@@ -103,6 +105,10 @@
 // =========================================================================
 // NEW, NEW_ARRAY, ALLOC, ALLOC_ARRAY
 
+#if !defined(_NEW_) && !defined(_NEW)
+#include <new> // new
+#endif
+
 NS_BOOST_MEMORY_BEGIN
 
 class unmanaged_
@@ -191,9 +197,17 @@
 
 NS_BOOST_MEMORY_END
 
-// -------------------------------------------------------------------------
+// =========================================================================
 // function swap_object
 
+#if !defined(_CSTRING_) && !defined(_CSTRING)
+#include <cstring> // memcpy
+#endif
+
+#if !defined(_INC_MALLOC) && !defined(_MALLOC_H)
+#include <malloc.h> // _alloca
+#endif
+
 NS_BOOST_MEMORY_BEGIN
 
 inline void swap(void* a, void* b, size_t cb)

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-22 15:27:16 EDT (Fri, 22 May 2009)
@@ -16,10 +16,6 @@
 #include "system_alloc.hpp"
 #endif
 
-#ifndef BOOST_MEMORY_THREAD_TLS_HPP
-#include "thread/tls.hpp"
-#endif
-
 #if !defined(_CLIMITS_) && !defined(_CLIMITS)
 #include <climits> // INT_MAX
 #endif
@@ -29,7 +25,7 @@
 // -------------------------------------------------------------------------
 // class proxy_alloc
 
-template <class AllocT, class TlsAllocT = int>
+template <class AllocT>
 class proxy_alloc
 {
 private:
@@ -37,7 +33,6 @@
 
 public:
         proxy_alloc(AllocT& alloc) : m_alloc(&alloc) {}
- proxy_alloc() : m_alloc(&TlsAllocT::instance()) {}
 
 public:
         enum { Padding = AllocT::Padding };
@@ -147,48 +142,9 @@
 #pragma pack()
 
 // -------------------------------------------------------------------------
-// class tls_block_pool
-
-typedef tls_object<block_pool> tls_block_pool_t;
-
-STDAPI_(tls_block_pool_t*) boost_TlsBlockPool();
-
-template <class Unused>
-class tls_block_pool_
-{
-private:
- static tls_block_pool_t* g_blockPool;
-
-public:
- tls_block_pool_() {
- init();
- }
- ~tls_block_pool_() {
- term();
- }
-
- static void BOOST_MEMORY_CALL init() {
- g_blockPool->init();
- }
-
- static void BOOST_MEMORY_CALL term() {
- g_blockPool->term();
- }
-
- static block_pool& BOOST_MEMORY_CALL instance() {
- return g_blockPool->get();
- }
-};
-
-template <class Unused>
-tls_block_pool_t* tls_block_pool_<Unused>::g_blockPool = boost_TlsBlockPool();
-
-typedef tls_block_pool_<int> tls_block_pool;
-
-// -------------------------------------------------------------------------
 // class pool
 
-typedef proxy_alloc<block_pool, tls_block_pool> proxy_block_pool;
+typedef proxy_alloc<block_pool> proxy_block_pool;
 
 NS_BOOST_MEMORY_POLICY_BEGIN
 

Deleted: sandbox/memory/boost/memory/linklib.hpp
==============================================================================
--- sandbox/memory/boost/memory/linklib.hpp 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
+++ (empty file)
@@ -1,27 +0,0 @@
-//
-// boost/memory/linklib.hpp
-//
-// Copyright (c) 2004 - 2008 xushiwei (xushiweizh_at_[hidden])
-//
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/memory/index.htm for documentation.
-//
-#ifndef BOOST_MEMORY_LINKLIB_HPP
-#define BOOST_MEMORY_LINKLIB_HPP
-
-// -------------------------------------------------------------------------
-
-#if !defined(BOOST_Linked_boost_memory)
-#define BOOST_Linked_boost_memory
-#if defined(_MSC_VER)
-# pragma comment(lib, "boost-memory")
-#endif
-#endif
-
-// -------------------------------------------------------------------------
-// $Log: linklib.hpp,v $
-
-#endif /* BOOST_MEMORY_LINKLIB_HPP */

Modified: sandbox/memory/libs/memory/examples/simplest/simple_examples.cpp
==============================================================================
--- sandbox/memory/libs/memory/examples/simplest/simple_examples.cpp (original)
+++ sandbox/memory/libs/memory/examples/simplest/simple_examples.cpp 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
@@ -10,7 +10,6 @@
 // See http://www.boost.org/libs/memory/index.htm for documentation.
 //
 #include <boost/memory.hpp>
-#include <boost/memory/linklib.hpp>
 
 // -------------------------------------------------------------------------
 
@@ -45,29 +44,12 @@
         int* e = BOOST_MEMORY_NEW(*suballoc, int);
 }
 
-void testTlsScopedAlloc()
-{
- NS_BOOST_MEMORY::scoped_alloc alloc;
- // same as: NS_BOOST_MEMORY::scoped_alloc(boost::memory::tls_block_pool::instance());
-
- int* intObj = BOOST_MEMORY_NEW(alloc, int);
- int* intObjWithArg = BOOST_MEMORY_NEW(alloc, int)(10);
- int* intArray = BOOST_MEMORY_NEW_ARRAY(alloc, int, 100);
- int* intBuf = BOOST_MEMORY_ALLOC(alloc, int);
- int* intArrayBuf = BOOST_MEMORY_ALLOC_ARRAY(alloc, int, 100);
-
- NS_BOOST_MEMORY::scoped_alloc* suballoc = BOOST_MEMORY_NEW(alloc, NS_BOOST_MEMORY::scoped_alloc);
-
- int* e = BOOST_MEMORY_NEW(*suballoc, int);
-}
-
 int main()
 {
         NS_BOOST_MEMORY::enableMemoryLeakCheck();
 
         testAutoAlloc();
         testScopedAlloc();
- testTlsScopedAlloc();
 
         return 0;
 }

Modified: sandbox/memory/libs/memory/examples/stl_containers/stl_containers.cpp
==============================================================================
--- sandbox/memory/libs/memory/examples/stl_containers/stl_containers.cpp (original)
+++ sandbox/memory/libs/memory/examples/stl_containers/stl_containers.cpp 2009-05-22 15:27:16 EDT (Fri, 22 May 2009)
@@ -17,7 +17,6 @@
 #include <cstdio>
 
 #include <boost/memory.hpp>
-#include <boost/memory/linklib.hpp>
 
 using NS_BOOST_MEMORY::stl_allocator;
 
@@ -28,7 +27,8 @@
 void testDeque()
 {
         printf("\n===== Deque (scoped_alloc) =====\n");
- NS_BOOST_MEMORY::scoped_alloc alloc;
+ NS_BOOST_MEMORY::block_pool recycle;
+ NS_BOOST_MEMORY::scoped_alloc alloc(recycle);
         std::deque<int, stl_allocator<int> > s(alloc);
         for (int i = 0; i < Count; ++i)
                 s.push_back(i);
@@ -37,7 +37,8 @@
 void testList()
 {
         printf("\n===== List (scoped_alloc) =====\n");
- NS_BOOST_MEMORY::scoped_alloc alloc;
+ NS_BOOST_MEMORY::block_pool recycle;
+ NS_BOOST_MEMORY::scoped_alloc alloc(recycle);
         std::list<int, stl_allocator<int> > s(alloc);
         for (int i = 0; i < Count; ++i)
                 s.push_back(i);
@@ -46,7 +47,8 @@
 void testSet()
 {
         printf("\n===== Set (scoped_alloc) =====\n");
- NS_BOOST_MEMORY::scoped_alloc alloc;
+ NS_BOOST_MEMORY::block_pool recycle;
+ NS_BOOST_MEMORY::scoped_alloc alloc(recycle);
         std::set<int, std::less<int>, stl_allocator<int> > s(std::less<int>(), alloc);
         for (int i = 0; i < Count; ++i)
                 s.insert(i);
@@ -55,7 +57,8 @@
 void testMap()
 {
         printf("\n===== Map (scoped_alloc) =====\n");
- NS_BOOST_MEMORY::scoped_alloc alloc;
+ NS_BOOST_MEMORY::block_pool recycle;
+ NS_BOOST_MEMORY::scoped_alloc alloc(recycle);
         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