|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53202 - sandbox/memory/boost/memory
From: xushiweizh_at_[hidden]
Date: 2009-05-23 08:35:31
Author: xushiwei
Date: 2009-05-23 08:35:30 EDT (Sat, 23 May 2009)
New Revision: 53202
URL: http://svn.boost.org/trac/boost/changeset/53202
Log:
pools_alloc::allocate
Text files modified:
sandbox/memory/boost/memory/pools_alloc.hpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Modified: sandbox/memory/boost/memory/pools_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/pools_alloc.hpp (original)
+++ sandbox/memory/boost/memory/pools_alloc.hpp 2009-05-23 08:35:30 EDT (Sat, 23 May 2009)
@@ -172,16 +172,25 @@
m_large_alloc.clear();
}
+private:
+ void* BOOST_MEMORY_CALL do_allocate_(size_type cb)
+ {
+ BOOST_MEMORY_ASSERT(cb == 0 || cb > MAX_BYTES);
+
+ if (cb != 0)
+ return m_large_alloc.allocate(cb);
+ else
+ return this + 1;
+ }
+
public:
void* BOOST_MEMORY_CALL allocate(size_type cb)
{
const size_type index = (cb - 1) >> ALIGN_BITS;
if (index < (size_type)NPOOL)
return ((FixedAllocT*)m_pools + index)->allocate(m_alloc);
- else if (cb != 0)
- return m_large_alloc.allocate(cb);
else
- return this + 1;
+ return do_allocate_(cb);
}
public:
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