Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57669 - sandbox/memory/boost/memory
From: xushiweizh_at_[hidden]
Date: 2009-11-15 02:43:16


Author: xushiwei
Date: 2009-11-15 02:43:14 EST (Sun, 15 Nov 2009)
New Revision: 57669
URL: http://svn.boost.org/trac/boost/changeset/57669

Log:
gcc log2
Text files modified:
   sandbox/memory/boost/memory/pools.hpp | 9 ++++++++-
   1 files changed, 8 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 02:43:14 EST (Sun, 15 Nov 2009)
@@ -47,7 +47,14 @@
 #pragma warning(pop)
 #endif
 
-#else // if defined(__GNUG__) || defined(__GNUC__) // g++/gcc
+#else if defined(__GNUG__) || defined(__GNUC__) // g++/gcc
+
+__forceinline unsigned int log2(IN unsigned int val) {
+ BOOST_MEMORY_ASSERT(val != 0);
+ asm(bsr $val, %eax);
+}
+
+#else
 
 #error "Error: to do - unsupport compiler!"
 


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