Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : change MC_take_snapshot_liveness declaration (snapshot returned inste...
[simgrid.git] / src / mc / mc_checkpoint.c
index 47d1be9..ad1de43 100644 (file)
@@ -112,9 +112,15 @@ void MC_take_snapshot(mc_snapshot_t snapshot)
   free_memory_map(maps);
 }
 
-void MC_take_snapshot_liveness(mc_snapshot_t snapshot)
+mc_snapshot_t MC_take_snapshot_liveness()
 {
 
+  raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  mc_snapshot_t snapshot = xbt_new0(s_mc_snapshot_t, 1);
+
   unsigned int i = 0;
   s_map_region_t reg;
   memory_map_t maps = get_memory_map();
@@ -176,6 +182,13 @@ void MC_take_snapshot_liveness(mc_snapshot_t snapshot)
   
   free_memory_map(maps);
 
+  MC_UNSET_RAW_MEM;
+
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
+
+  return snapshot;
+
 }
 
 void MC_restore_snapshot(mc_snapshot_t snapshot)