Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-05-07 08:18:25


Author: xushiwei
Date: 2008-05-07 08:18:25 EDT (Wed, 07 May 2008)
New Revision: 45195
URL: http://svn.boost.org/trac/boost/changeset/45195

Log:
t
Text files modified:
   sandbox/memory/boost/memory/gc_alloc.hpp | 12 ++++++------
   sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp | 1 +
   2 files changed, 7 insertions(+), 6 deletions(-)

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-07 08:18:25 EDT (Wed, 07 May 2008)
@@ -456,11 +456,11 @@
                 if (cbAlloc >= AllocSizeHuge)
                         return m_hugeAlloc.allocate(cb, fn);
                 
- DestroyInfo* pNode = (DestroyInfo*)allocate(sizeof(DestroyInfo) + cb);
+ MemHeaderEx* pNode = (MemHeaderEx*)((char*)allocate(sizeof(DestroyInfo) + cb) - sizeof(MemHeader));
                 pNode->fnDestroy = fn;
                 pNode->pPrev = m_destroyChain;
- m_destroyChain = (MemHeaderEx*)((char*)pNode - sizeof(MemHeader));
- m_destroyChain->nodeType = nodeAllocedWithDestructor;
+ pNode->nodeType = nodeAllocedWithDestructor;
+ m_destroyChain = pNode;
                 return pNode + 1;
         }
 
@@ -473,9 +473,9 @@
         {
                 BOOST_MEMORY_ASSERT(cb + sizeof(MemHeaderEx) < AllocSizeHuge);
 
- DestroyInfo* pNode = (DestroyInfo*)allocate(sizeof(DestroyInfo) + cb);
- pNode->fnDestroy = fn;
- return pNode + 1;
+ DestroyInfo* pInfo = (DestroyInfo*)allocate(sizeof(DestroyInfo) + cb);
+ pInfo->fnDestroy = fn;
+ return pInfo + 1;
         }
 
         void* BOOST_MEMORY_CALL manage(void* p, destructor_t fn)

Modified: sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp (original)
+++ sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp 2008-05-07 08:18:25 EDT (Wed, 07 May 2008)
@@ -9,6 +9,7 @@
 //
 // See http://www.boost.org/libs/memory/index.htm for documentation.
 //
+// #define BOOST_MEMORY_NO_STRICT_EXCEPTION_SEMANTICS
 #include <boost/memory.hpp>
 #include <boost/detail/performance_counter.hpp>
 


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