Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change the default value of maxmin/concurrency_limit to -1 (+cosmetics)
[simgrid.git] / src / xbt / xbt_main.cpp
index 945304e..403d4cb 100644 (file)
@@ -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 <math.h>
 #include "xbt/misc.h"
 #include "simgrid_config.h"
 #include "xbt/sysdep.h"
@@ -88,18 +88,13 @@ 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... */
   _set_output_format(_TWO_DIGIT_EXPONENT);
 #endif
   xbt_log_preinit();
-  xbt_backtrace_preinit();
   xbt_os_thread_mod_preinit();
   xbt_fifo_preinit();
   xbt_dict_preinit();
@@ -115,7 +110,6 @@ static void xbt_postexit(void)
 {
   if(!_sg_do_clean_atexit) return;
   xbt_initialized--;
-  xbt_backtrace_postexit();
   xbt_fifo_postexit();
   xbt_dict_postexit();
   xbt_os_thread_mod_postexit();