From: Martin Quinson Date: Sun, 21 Aug 2016 15:07:05 +0000 (+0200) Subject: no need to manually compute the log2 X-Git-Tag: v3_14~513 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5e527676971fb96328a618048f50f27e6a505df3 no need to manually compute the log2 --- diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index 945304e143..d90feb101c 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -8,7 +8,7 @@ #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */ - +#include #include "xbt/misc.h" #include "simgrid_config.h" #include "xbt/sysdep.h" @@ -88,11 +88,7 @@ static void xbt_preinit(void) { #error Cannot get page size. #endif - xbt_pagebits = 0; - int x = xbt_pagesize; - while(x >>= 1) { - ++xbt_pagebits; - } + xbt_pagebits = log2(xbt_pagesize); #ifdef _TWO_DIGIT_EXPONENT /* Even printf behaves differently on Windows... */