|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57680 - sandbox/memory/boost/memory
From: xushiweizh_at_[hidden]
Date: 2009-11-15 04:25:16
Author: xushiwei
Date: 2009-11-15 04:25:15 EST (Sun, 15 Nov 2009)
New Revision: 57680
URL: http://svn.boost.org/trac/boost/changeset/57680
Log:
t
Text files modified:
sandbox/memory/boost/memory/pools.hpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
Modified: sandbox/memory/boost/memory/pools.hpp
==============================================================================
--- sandbox/memory/boost/memory/pools.hpp (original)
+++ sandbox/memory/boost/memory/pools.hpp 2009-11-15 04:25:15 EST (Sun, 15 Nov 2009)
@@ -49,7 +49,8 @@
#elif defined(__GNUG__) || defined(__GNUC__) // g++/gcc
-__forceinline unsigned int log2(IN unsigned int val) {
+__forceinline unsigned int log2(IN unsigned int val)
+{
BOOST_MEMORY_ASSERT(val != 0);
unsigned int result;
__asm__("bsr %0, %%eax"::"m"(val));
@@ -62,8 +63,10 @@
__forceinline unsigned int log2(IN unsigned int val)
{
BOOST_MEMORY_ASSERT(val != 0);
+
if (!(val & 0xFFFFFFFFU))
return 0xCDCDCDCDU;
+
unsigned int result = 31, mask = (1 << 31);
for (;;)
{
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