Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move stacks_areas into Process
[simgrid.git] / src / mc / mc_diff.cpp
index 2abb326..6cf5993 100644 (file)
@@ -25,7 +25,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_diff, xbt,
                                 "Logging specific to mc_diff in mc");
 
 xbt_dynar_t mc_heap_comparison_ignore;
-xbt_dynar_t stacks_areas;
 
 /*********************************** Heap comparison ***********************************/
 /***************************************************************************************/
@@ -50,7 +49,7 @@ struct XBT_PRIVATE s_mc_diff {
 #define types1_(i,j) types1[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)]
 #define types2_(i,j) types2[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)]
 
-__thread struct s_mc_diff *mc_diff_info = NULL;
+static __thread struct s_mc_diff *mc_diff_info = nullptr;
 
 /*********************************** Free functions ************************************/
 
@@ -140,31 +139,21 @@ static ssize_t heap_comparison_ignore_size(std::vector<s_mc_heap_ignore_region_t
   return -1;
 }
 
-static int is_stack(const void *address)
+static bool is_stack(const void *address)
 {
-  unsigned int cursor = 0;
-  stack_region_t stack;
-
-  xbt_dynar_foreach(stacks_areas, cursor, stack) {
-    if (address == stack->address)
-      return 1;
-  }
-
-  return 0;
+  for (auto const& stack : mc_model_checker->process().stack_areas())
+    if (address == stack.address)
+      return true;
+  return false;
 }
 
 // TODO, this should depend on the snapshot?
-static int is_block_stack(int block)
+static bool is_block_stack(int block)
 {
-  unsigned int cursor = 0;
-  stack_region_t stack;
-
-  xbt_dynar_foreach(stacks_areas, cursor, stack) {
-    if (block == stack->block)
-      return 1;
-  }
-
-  return 0;
+  for (auto const& stack : mc_model_checker->process().stack_areas())
+    if (block == stack.block)
+      return true;
+  return false;
 }
 
 static void match_equals(struct s_mc_diff *state, xbt_dynar_t list)