Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-04-29 23:34:55


Author: xushiwei
Date: 2008-04-29 23:34:55 EDT (Tue, 29 Apr 2008)
New Revision: 44911
URL: http://svn.boost.org/trac/boost/changeset/44911

Log:
ticket #1885: gc_alloc::newArray
Text files modified:
   sandbox/memory/boost/memory/gc_alloc.hpp | 7 ++++---
   1 files changed, 4 insertions(+), 3 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-04-29 23:34:55 EDT (Tue, 29 Apr 2008)
@@ -217,7 +217,8 @@
 private:
         enum { HeaderSize = sizeof(void*) };
         enum { BlockSize = MemBlockSize - HeaderSize };
- enum { AllocSizeBig = MIN(_Policy::AllocSizeBig, BlockSize/2) };
+ enum { _AllocSizeBigDef = MAX(_Policy::AllocSizeBig, BlockSize/4) };
+ enum { AllocSizeBig = MIN(_AllocSizeBigDef, BlockSize/2) };
         enum { AllocSizeHuge = _Policy::AllocSizeHuge };
         enum { RecycleSizeMin = MAX(_Policy::RecycleSizeMin, 128) };
 
@@ -374,7 +375,7 @@
         template <class Type>
         void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count)
         {
- BOOST_MEMORY_ASSERT( _IsValidArray(obj, count) );
+ BOOST_MEMORY_ASSERT( _IsValidArray(array, count) );
 
                 size_t cb = destructor_traits<Type>::getArrayAllocSize(count);
                 if (cb >= AllocSizeHuge)
@@ -384,7 +385,7 @@
                 else
                 {
                         destructor_traits<Type>::destructArrayN(array, count);
- void* pData = destructor_traits<Type>::getArrayBuffer(array),
+ void* pData = destructor_traits<Type>::getArrayBuffer(array);
                         _MemHeaderEx* p = (_MemHeaderEx*)pData - 1;
                         p->blkType = nodeFree;
                 }


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