Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove ugly #include
[simgrid.git] / src / mc / mcer_ignore.cpp
index 08cb7b0..ed25728 100644 (file)
@@ -112,12 +112,9 @@ void MC_heap_region_ignore_remove(void *address, size_t size)
 void MCer_ignore_global_variable(const char *name)
 {
   mc_process_t process = &mc_model_checker->process();
-  xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
-  xbt_assert(process->object_infos, "MC subsystem not initialized");
+  xbt_assert(!process->object_infos.empty(), "MC subsystem not initialized");
 
-  size_t n = process->object_infos_size;
-  for (size_t i=0; i!=n; ++i) {
-    mc_object_info_t info = process->object_infos[i];
+  for (std::shared_ptr<s_mc_object_info_t> const& info : process->object_infos) {
 
     // Binary search:
     int start = 0;
@@ -138,7 +135,6 @@ void MCer_ignore_global_variable(const char *name)
       }
     }
   }
-  mmalloc_set_current_heap(heap);
 }
 
 // ***** Ignore local variables
@@ -156,15 +152,9 @@ void MC_ignore_local_variable(const char *var_name, const char *frame_name)
   mc_process_t process = &mc_model_checker->process();
   if (strcmp(frame_name, "*") == 0)
     frame_name = NULL;
-  xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
 
-  size_t n = process->object_infos_size;
-  size_t i;
-  for (i=0; i!=n; ++i) {
-    MC_ignore_local_variable_in_object(var_name, frame_name, process->object_infos[i]);
-  }
-
-  mmalloc_set_current_heap(heap);
+  for (std::shared_ptr<s_mc_object_info_t> const& info : process->object_infos)
+    MC_ignore_local_variable_in_object(var_name, frame_name, info.get());
 }
 
 static void MC_ignore_local_variable_in_object(const char *var_name,
@@ -243,4 +233,13 @@ static void mc_ignore_local_variable_in_scope(const char *var_name,
   }
 }
 
+extern xbt_dynar_t stacks_areas;
+
+void MC_stack_area_add(stack_region_t stack_area)
+{
+  if (stacks_areas == NULL)
+    stacks_areas = xbt_dynar_new(sizeof(stack_region_t), NULL);
+  xbt_dynar_push(stacks_areas, &stack_area);
+}
+
 }