Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove compatibility stuff
[simgrid.git] / src / mc / mc_compare.cpp
index 2d66dba..3374e5c 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #define __STDC_FORMAT_MACROS
-#include <inttypes.h>
+#include <cinttypes>
 #include <boost/unordered_set.hpp>
 
 #include <xbt/sysdep.h>
@@ -104,7 +104,7 @@ static int compare_areas_with_type(struct mc_compare_state& state,
                                    void* real_area2, mc_snapshot_t snapshot2, mc_mem_region_t region2,
                                    dw_type_t type, int pointer_level)
 {
-  mc_process_t process = &mc_model_checker->process;
+  mc_process_t process = &mc_model_checker->process();
 
   unsigned int cursor = 0;
   dw_type_t member, subtype, subsubtype;
@@ -232,9 +232,9 @@ static int compare_areas_with_type(struct mc_compare_state& state,
   case DW_TAG_class_type:
     xbt_dynar_foreach(type->members, cursor, member) {
       void *member1 =
-        mc_member_resolve(real_area1, type, member, (mc_address_space_t) snapshot1, process_index);
+        mc_member_resolve(real_area1, type, member, snapshot1, process_index);
       void *member2 =
-        mc_member_resolve(real_area2, type, member, (mc_address_space_t) snapshot2, process_index);
+        mc_member_resolve(real_area2, type, member, snapshot2, process_index);
       mc_mem_region_t subregion1 = mc_get_region_hinted(member1, snapshot1, process_index, region1);
       mc_mem_region_t subregion2 = mc_get_region_hinted(member2, snapshot2, process_index, region2);
       res =
@@ -387,7 +387,7 @@ static int compare_local_variables(int process_index,
 
 int snapshot_compare(void *state1, void *state2)
 {
-  mc_process_t process = &mc_model_checker->process;
+  mc_process_t process = &mc_model_checker->process();
 
   mc_snapshot_t s1, s2;
   int num1, num2;
@@ -492,14 +492,14 @@ int snapshot_compare(void *state1, void *state2)
 #endif
 
   /* Init heap information used in heap comparison algorithm */
-  xbt_mheap_t heap1 = (xbt_mheap_t) MC_snapshot_read(
-    s1, MC_ADDRESS_SPACE_READ_FLAGS_LAZY,
-    alloca(sizeof(struct mdesc)), process->heap_address, sizeof(struct mdesc),
-    MC_PROCESS_INDEX_MISSING);
-  xbt_mheap_t heap2 = (xbt_mheap_t) MC_snapshot_read(
-    s2, MC_ADDRESS_SPACE_READ_FLAGS_LAZY,
-    alloca(sizeof(struct mdesc)), process->heap_address, sizeof(struct mdesc),
-    MC_PROCESS_INDEX_MISSING);
+  xbt_mheap_t heap1 = (xbt_mheap_t)s1->read_bytes(
+    alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+    (std::uint64_t)process->heap_address,
+    simgrid::mc::ProcessIndexMissing, simgrid::mc::AddressSpace::Lazy);
+  xbt_mheap_t heap2 = (xbt_mheap_t)s2->read_bytes(
+    alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+    (std::uint64_t)process->heap_address,
+    simgrid::mc::ProcessIndexMissing, simgrid::mc::AddressSpace::Lazy);
   res_init = init_heap_information(heap1, heap2, s1->to_ignore, s2->to_ignore);
   if (res_init == -1) {
 #ifdef MC_DEBUG
@@ -604,7 +604,7 @@ int snapshot_compare(void *state1, void *state2)
 
     /* Compare global variables */
     is_diff =
-      compare_global_variables(region1->object_info, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
+      compare_global_variables(region1->object_info, simgrid::mc::AddressSpace::Normal,
         region1, region2,
         s1, s2);