Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix name of mc_snapshot_memcmp()
[simgrid.git] / src / mc / mc_compare.cpp
index ada39e6..cbaedb5 100644 (file)
@@ -103,12 +103,9 @@ static int compare_areas_with_type(struct mc_compare_state& state,
   case DW_TAG_enumeration_type:
   case DW_TAG_union_type:
   {
-    void* data1 =
-      mc_snapshot_read_region(real_area1, region1, alloca(type->byte_size), type->byte_size);
-    void* data2 =
-      mc_snapshot_read_region(real_area2, region1, alloca(type->byte_size), type->byte_size);
-    return (memcmp(data1, data2, type->byte_size) != 0);
-    break;
+    return mc_snapshot_region_memcmp(
+      real_area1, region1, real_area2, region2,
+      type->byte_size) != 0;
   }
   case DW_TAG_typedef:
   case DW_TAG_volatile_type:
@@ -160,9 +157,8 @@ static int compare_areas_with_type(struct mc_compare_state& state,
   case DW_TAG_reference_type:
   case DW_TAG_rvalue_reference_type:
   {
-    void* temp;
-    void* addr_pointed1 = *(void**) mc_snapshot_read_region(real_area1, region1, &temp, sizeof(void**));
-    void* addr_pointed2 = *(void**) mc_snapshot_read_region(real_area2, region2, &temp, sizeof(void**));
+    void* addr_pointed1 = mc_snapshot_read_pointer_region(real_area1, region1);
+    void* addr_pointed2 = mc_snapshot_read_pointer_region(real_area2, region2);
 
     if (type->subtype && type->subtype->type == DW_TAG_subroutine_type) {
       return (addr_pointed1 != addr_pointed2);