X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8a8687d6595e9e5e81a7b658ad1ae4c3f5d86539..64916baf9d485ba6a2546bf79c948c591a233465:/src/xbt/xbt_main.cpp diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index 026641b33b..496cc47da9 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -8,11 +8,12 @@ #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" #include "xbt/log.h" +#include "xbt/log.hpp" #include "xbt/dynar.h" #include "xbt/config.h" @@ -87,20 +88,14 @@ 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(); srand(seed); @@ -114,8 +109,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(); xbt_dynar_free(&xbt_cmdline); @@ -129,7 +122,7 @@ static void xbt_postexit(void) /** @brief Initialize the xbt mechanisms. */ void xbt_init(int *argc, char **argv) { - xbt_set_terminate(); + simgrid::xbt::installExceptionHandler(); if (xbt_initialized++) { XBT_DEBUG("XBT was initialized %d times.", xbt_initialized);