Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove the reference count of the elements from the setset container. This allow...
[simgrid.git] / src / xbt / xbt_main.c
index 337164d..16d5d75 100644 (file)
@@ -79,6 +79,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
 #endif
 
 static void xbt_preinit(void) {
+  mmalloc_preinit();
   xbt_log_preinit();
 
   /* Connect our log channels: that must be done manually under windows */
@@ -106,6 +107,7 @@ static void xbt_preinit(void) {
   XBT_LOG_CONNECT(xbt_sync_os, xbt);
 
   xbt_fifo_preinit();
+  xbt_dict_preinit();
 
   xbt_backtrace_preinit();
   xbt_os_thread_mod_preinit();
@@ -121,14 +123,18 @@ static void xbt_postexit(void) {
   xbt_log_postexit();
 
   free(xbt_binary_name);
+  mmalloc_postexit();
 }
 
 /** @brief Initialize the xbt mechanisms. */
 void xbt_init(int *argc, char **argv)
 {
-  xbt_assert0(xbt_initialized == 0, "xbt_init must be called only once");
+  // FIXME it would be nice to assert that this function is called only once. But each gras process do call it...
   xbt_initialized++;
 
+  if (xbt_initialized >1)
+    return;
+
   xbt_binary_name = xbt_strdup(argv[0]);
   srand((unsigned int) time(NULL));
   VERB0("Initialize XBT");
@@ -138,6 +144,7 @@ void xbt_init(int *argc, char **argv)
 
 /** @brief Finalize the xbt mechanisms. */
 void xbt_exit() {
+  WARN0("This function is deprecated, you shouldn't use it");
 }