Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61402 - sandbox/memory/boost/memory
From: xushiweizh_at_[hidden]
Date: 2010-04-19 06:49:47


Author: xushiwei
Date: 2010-04-19 06:49:46 EDT (Mon, 19 Apr 2010)
New Revision: 61402
URL: http://svn.boost.org/trac/boost/changeset/61402

Log:
static region_alloc::deallocate;
Text files modified:
   sandbox/memory/boost/memory/auto_alloc.hpp | 18 +++++++++---------
   sandbox/memory/boost/memory/region_alloc.hpp | 32 ++++++++++++++++----------------
   2 files changed, 25 insertions(+), 25 deletions(-)

Modified: sandbox/memory/boost/memory/auto_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/auto_alloc.hpp (original)
+++ sandbox/memory/boost/memory/auto_alloc.hpp 2010-04-19 06:49:46 EDT (Mon, 19 Apr 2010)
@@ -45,6 +45,10 @@
                 BaseClass::clear();
         }
 
+ __forceinline void* BOOST_MEMORY_CALL reallocate(void* p, size_t oldSize, size_t newSize) {
+ return BaseClass::reallocate(p, oldSize, newSize);
+ }
+
         __forceinline void* BOOST_MEMORY_CALL allocate(size_t cb) {
                 return BaseClass::allocate(cb);
         }
@@ -71,29 +75,25 @@
                 return BaseClass::allocate(cb);
         }
 
- __forceinline void BOOST_MEMORY_CALL manage(void* p, int fnZero) {
+ __forceinline static void BOOST_MEMORY_CALL manage(void* p, int fnZero) {
                 // no action
         }
 
- void* BOOST_MEMORY_CALL reallocate(void* p, size_t oldSize, size_t newSize) {
- return BaseClass::reallocate(p, oldSize, newSize);
- }
-
- void BOOST_MEMORY_CALL deallocate(void* p, size_t cb) {
+ __forceinline static void BOOST_MEMORY_CALL deallocate(void* p, size_t cb) {
                 // no action
         }
 
- void BOOST_MEMORY_CALL deallocate(void* p) {
+ __forceinline static void BOOST_MEMORY_CALL deallocate(void* p) {
                 // no action
         }
 
         template <class Type>
- void BOOST_MEMORY_CALL destroy(Type* obj) {
+ __forceinline static void BOOST_MEMORY_CALL destroy(Type* obj) {
                 // no action
         }
 
         template <class Type>
- void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count) {
+ __forceinline static void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count) {
                 // no action
         }
 };

Modified: sandbox/memory/boost/memory/region_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/region_alloc.hpp (original)
+++ sandbox/memory/boost/memory/region_alloc.hpp 2010-04-19 06:49:46 EDT (Mon, 19 Apr 2010)
@@ -131,6 +131,17 @@
                 m_begin = m_end = (char*)HeaderSize;
         }
 
+ void* BOOST_MEMORY_CALL reallocate(void* p, size_t oldSize, size_t newSize)
+ {
+ BOOST_MEMORY_CHECK_THREAD();
+
+ if (oldSize >= newSize)
+ return p;
+ void* p2 = allocate(newSize);
+ memcpy(p2, p, oldSize);
+ return p2;
+ }
+
 private:
         void* BOOST_MEMORY_CALL do_allocate_(size_t cb)
         {
@@ -209,40 +220,29 @@
                 return allocate(cb);
         }
 
- __forceinline void BOOST_MEMORY_CALL manage(void* p, int fnZero)
+ __forceinline static void BOOST_MEMORY_CALL manage(void* p, int fnZero)
         {
                 // no action
         }
 
- void* BOOST_MEMORY_CALL reallocate(void* p, size_t oldSize, size_t newSize)
- {
- BOOST_MEMORY_CHECK_THREAD();
-
- if (oldSize >= newSize)
- return p;
- void* p2 = allocate(newSize);
- memcpy(p2, p, oldSize);
- return p2;
- }
-
- void BOOST_MEMORY_CALL deallocate(void* p)
+ __forceinline static void BOOST_MEMORY_CALL deallocate(void* p)
         {
                 // no action
         }
 
- void BOOST_MEMORY_CALL deallocate(void* p, size_t cb)
+ __forceinline static void BOOST_MEMORY_CALL deallocate(void* p, size_t cb)
         {
                 // no action
         }
 
         template <class Type>
- void BOOST_MEMORY_CALL destroy(Type* obj)
+ __forceinline static void BOOST_MEMORY_CALL destroy(Type* obj)
         {
                 // no action
         }
 
         template <class Type>
- void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count)
+ __forceinline static void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count)
         {
                 // no action
         }


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