const int xbt_pagesize = static_cast<int>(sysconf(_SC_PAGESIZE));
const int xbt_pagebits = static_cast<int>(log2(xbt_pagesize));
-/* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library.
- * This is crude and rather compiler-specific, unfortunately.
- */
-static void xbt_preinit() XBT_ATTRIB_CONSTRUCTOR(200);
-static void xbt_postexit();
XBT_ATTRIB_NOINLINE void sthread_enable()
{ // These symbols are used from ContextSwapped in any case, but they are only useful
asm("");
asm("");
}
-static void xbt_preinit()
-{
- atexit(xbt_postexit);
-}
-
static void xbt_postexit()
{
if (not cfg_dbg_clean_atexit)
XBT_DEBUG("XBT has been initialized %d times.", xbt_initialized);
return;
}
+ atexit(xbt_postexit);
simgrid::xbt::install_exception_handler();