Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65442 - sandbox/memory/boost/memory
From: xushiweizh_at_[hidden]
Date: 2010-09-16 21:57:39


Author: xushiwei
Date: 2010-09-16 21:57:30 EDT (Thu, 16 Sep 2010)
New Revision: 65442
URL: http://svn.boost.org/trac/boost/changeset/65442

Log:
bug fix: pools_alloc.allocate(bytes: 21 - 24) on 32 bits system.
Text files modified:
   sandbox/memory/boost/memory/pool_alloc.hpp | 2 +-
   sandbox/memory/boost/memory/pools.hpp | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Modified: sandbox/memory/boost/memory/pool_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/pool_alloc.hpp (original)
+++ sandbox/memory/boost/memory/pool_alloc.hpp 2010-09-16 21:57:30 EDT (Thu, 16 Sep 2010)
@@ -77,7 +77,7 @@
         void BOOST_MEMORY_CALL init_(size_type cbElem)
         {
                 cbElem = ROUND(cbElem, sizeof(void*));
- m_cbChunk = MAX(cbElem, MinElemBytes);
+ m_cbChunk = MAX(cbElem, (size_type)MinElemBytes);
                 m_nChunkPerBlock = BlockSize/m_cbChunk;
                 m_freelist = NULL;
                 m_blks = NULL;

Modified: sandbox/memory/boost/memory/pools.hpp
==============================================================================
--- sandbox/memory/boost/memory/pools.hpp (original)
+++ sandbox/memory/boost/memory/pools.hpp 2010-09-16 21:57:30 EDT (Thu, 16 Sep 2010)
@@ -124,7 +124,7 @@
 
 public:
         pools_alloc()
- : m_poolAlloc(sizeof(pool_type))
+ : m_poolAlloc(ROUND(sizeof(pool_type), 1 << ALIGN_BITS1))
         {
                 memset(m_pools, 0, sizeof(pool_type*)*NPOOL);
 


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