Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid
authorChristophe Thiéry <christopho128@gmail.com>
Mon, 18 Apr 2011 09:09:40 +0000 (11:09 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Mon, 18 Apr 2011 09:09:40 +0000 (11:09 +0200)
src/msg/global.c
src/simdag/sd_global.c
src/surf/surf.c
src/xbt/dynar.c
tools/gras/stub_generator.c

index 6aa780d..55d4b0a 100644 (file)
@@ -197,11 +197,6 @@ MSG_error_t MSG_clean(void)
 
   SIMIX_clean();
 
-  // Exit the LIB host_lib
-  xbt_lib_free(&host_lib);
-  xbt_lib_free(&link_lib);
-  xbt_lib_free(&as_router_lib);
-
   return MSG_OK;
 }
 
index 87a0995..e3f7a55 100644 (file)
@@ -424,11 +424,6 @@ void SD_exit(void)
     XBT_DEBUG("Exiting Surf...");
     surf_exit();
 
-    // Exit the LIB host_lib
-    xbt_lib_free(&host_lib);
-    xbt_lib_free(&link_lib);
-    xbt_lib_free(&as_router_lib);
-
     xbt_free(sd_global);
     sd_global = NULL;
 
index e8d350f..74f7519 100644 (file)
@@ -382,9 +382,14 @@ void surf_exit(void)
   if (surf_path)
     xbt_dynar_free(&surf_path);
 
+  xbt_lib_free(&host_lib);
+  xbt_lib_free(&link_lib);
+  xbt_lib_free(&as_router_lib);
+
   tmgr_finalize();
   surf_parse_lex_destroy();
   surf_parse_free_callbacks();
+
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }
 
index 52d11fb..51d207b 100644 (file)
@@ -676,12 +676,13 @@ XBT_INLINE void xbt_dynar_shift(xbt_dynar_t const dynar, void *const dst)
 
 static void _dynar_map(const xbt_dynar_t dynar, void_f_pvoid_t const op)
 {
-  char elm[SIZEOF_MAX];
+  char *const data = (char *) dynar->data;
+  const unsigned long elmsize = dynar->elmsize;
   const unsigned long used = dynar->used;
-  unsigned long i = 0;
+  unsigned long i;
 
   for (i = 0; i < used; i++) {
-    _xbt_dynar_get_elm(elm, dynar, i);
+    char* elm = (char*) data + i * elmsize;
     (*op) (elm);
   }
 }
index 6c02c9d..0b1bd17 100644 (file)
 #include "gras_stub_generator.h"
 #include <stdarg.h>
 
-
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
 
-
 #ifdef _XBT_WIN32
 #include <windows.h>
 #endif
@@ -176,6 +173,11 @@ int main(int argc, char *argv[])
 #endif
 
   free(warning);
+
+  xbt_dict_free(&process_function_set);
+  xbt_dynar_free(&process_list);
+  xbt_dict_free(&machine_set);
   surf_exit();
+
   return 0;
 }