Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix MC_free_object
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 7 May 2015 08:53:28 +0000 (10:53 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 7 May 2015 08:53:28 +0000 (10:53 +0200)
xbt_free() does not take a pointer to the pointer but the pointer.
This behaviour is different from xbt_dict_free, xbt_dynar_free...

src/mc/mc_dwarf.cpp
src/mc/mc_snapshot.cpp

index ea37410..4af3c25 100644 (file)
@@ -1114,12 +1114,12 @@ mc_object_info_t MC_new_object_info(void)
 
 void MC_free_object_info(mc_object_info_t * info)
 {
-  xbt_free(&(*info)->file_name);
+  xbt_free((*info)->file_name);
   xbt_dict_free(&(*info)->subprograms);
   xbt_dynar_free(&(*info)->global_variables);
   xbt_dict_free(&(*info)->types);
   xbt_dict_free(&(*info)->full_types_by_name);
-  xbt_free(info);
+  xbt_free(*info);
   xbt_dynar_free(&(*info)->functions_index);
   *info = NULL;
 }
index b752c9c..7c587f9 100644 (file)
@@ -193,17 +193,15 @@ static inline void init_memory(void* mem, size_t size)
 
 static void test_snapshot(bool sparse_checkpoint);
 
-XBT_TEST_UNIT("page_snapshots", test_per_snpashots, "Test per-page snapshots")
-{
-  test_snapshot(1);
-}
-
-
 XBT_TEST_UNIT("flat_snapshot", test_flat_snapshots, "Test flat snapshots")
 {
   test_snapshot(0);
 }
 
+XBT_TEST_UNIT("page_snapshots", test_per_snpashots, "Test per-page snapshots")
+{
+  test_snapshot(1);
+}
 
 static void test_snapshot(bool sparse_checkpoint) {