Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc-fix' into mc-fastsnapshot
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Jul 2014 11:43:29 +0000 (13:43 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Jul 2014 11:43:29 +0000 (13:43 +0200)
Conflicts:
src/mc/mc_diff.c

1  2 
src/mc/mc_diff.c

@@@ -580,8 -592,7 +580,7 @@@ int mmalloc_compare_heap(mc_snapshot_t 
                             (char *) ((xbt_mheap_t) state->s_heap)->heapbase));
              addr_frag2 =
                  (void *) ((char *) addr_block2 +
-                           (j1 << ((xbt_mheap_t) state->s_heap)->heapinfo[i1].
-                            type));
 -                          (j1 << state->heapinfo2[i1].type));
++                          (j1 << heapinfo2->type));
  
              res_compare =
                  compare_heap_area(addr_frag1, addr_frag2, snapshot1, snapshot2,
                             (char *) ((xbt_mheap_t) state->s_heap)->heapbase));
              addr_frag2 =
                  (void *) ((char *) addr_block2 +
-                           (j2 << ((xbt_mheap_t) state->s_heap)->heapinfo[i2].
-                            type));
 -                          (j2 << state->heapinfo2[i2].type));
++                          (j2 << heapinfo2b->type));
  
              res_compare =
                  compare_heap_area(addr_frag1, addr_frag2, snapshot2, snapshot2,
@@@ -1126,8 -1181,9 +1124,7 @@@ int compare_heap_area(void *area1, voi
    ssize_t size;
    int check_ignore = 0;
  
 -  void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2, *real_addr_block1,
 -      *real_addr_block2, *real_addr_frag1, *real_addr_frag2;
 -
 +  void *real_addr_block1, *real_addr_block2, *real_addr_frag1, *real_addr_frag2;
    int type_size = -1;
    int offset1 = 0, offset2 = 0;
    int new_size1 = -1, new_size2 = -1;
  
    int match_pairs = 0;
  
 -  void *area1_to_compare = (char *) state->heapbase1 + ((char *)area1 - (char*)((xbt_mheap_t) state->s_heap)->heapbase);
 -  void *area2_to_compare = (char *) state->heapbase2 + ((char *)area2 - (char*)((xbt_mheap_t) state->s_heap)->heapbase);
 +  malloc_info* heapinfos1 = mc_snapshot_read_pointer(&((xbt_mheap_t)std_heap)->heapinfo, snapshot1);
 +  malloc_info* heapinfos2 = mc_snapshot_read_pointer(&((xbt_mheap_t)std_heap)->heapinfo, snapshot2);
 +
 +  malloc_info heapinfo_temp1, heapinfo_temp2;
 +
+   void* real_area1_to_compare = area1;
+   void* real_area2_to_compare = area2;
    if (previous == NULL) {
      previous =
          xbt_dynar_new(sizeof(heap_area_pair_t), heap_area_pair_free_voidp);
      }
  
      if (type_size != -1) {
 -      if (type_size != state->heapinfo1[block1].busy_block.busy_size
 -          && type_size != state->heapinfo2[block2].busy_block.busy_size
 +      if (type_size != heapinfo1->busy_block.busy_size
 +          && type_size != heapinfo2->busy_block.busy_size
-           && type->name != NULL && !strcmp(type->name, "s_smx_context")) {
+           && type->name != NULL && !strcmp(type->name, "struct s_smx_context")) {
          if (match_pairs) {
            match_equals(state, previous);
            xbt_dynar_free(&previous);
      // Process address of the fragment:
      real_addr_frag1 =
          (void *) ((char *) real_addr_block1 +
-                   (frag1 << ((xbt_mheap_t) state->s_heap)->heapinfo[block1].
-                    type));
 -                  (frag1 << state->heapinfo1[block1].type));
++                  (frag1 << heapinfo1->type));
      real_addr_frag2 =
          (void *) ((char *) real_addr_block2 +
-                   (frag2 << ((xbt_mheap_t) state->s_heap)->heapinfo[block2].
-                    type));
 -                  (frag2 << state->heapinfo2[block2].type));
++                  (frag2 << heapinfo2->type));
  
      // Check the size of the fragments against the size of the type:
      if (type_size != -1) {
          }
          return -1;
        }
 -
+       // ?
 -      if (type_size != state->heapinfo1[block1].busy_frag.frag_size[frag1]
 -          || type_size != state->heapinfo2[block2].busy_frag.frag_size[frag2]) {
 +      if (type_size != heapinfo1->busy_frag.frag_size[frag1]
 +          || type_size != heapinfo2->busy_frag.frag_size[frag2]) {
          if (match_pairs) {
            match_equals(state, previous);
            xbt_dynar_free(&previous);
          return 1;
        }
      }
      // Size of the fragment:
 -    size = state->heapinfo1[block1].busy_frag.frag_size[frag1];
 +    size = heapinfo1->busy_frag.frag_size[frag1];
  
      // Remember (basic) type inference.
-     // The current data structure only allows us to do this for the whole block.
+     // The current data structure only allows us to do this for the whole fragment.
      if (type != NULL && area1 == real_addr_frag1) {
        state->types1_(block1, frag1) = type;
      }
    /* Start comparison */
    if (type) {
      res_compare =
-         compare_heap_area_with_type(state, area1, area2, snapshot1, snapshot2,
 -        compare_heap_area_with_type(state, real_area1_to_compare, real_area2_to_compare,
 -                                    area1_to_compare, area2_to_compare,
 -                                    snapshot1, snapshot2,
++        compare_heap_area_with_type(state, real_area1_to_compare, real_area2_to_compare, snapshot1, snapshot2,
                                      previous, type, size, check_ignore,
                                      pointer_level);
    } else {
      res_compare =
-         compare_heap_area_without_type(state, area1, area2, snapshot1, snapshot2,
 -        compare_heap_area_without_type(state, real_area1_to_compare, real_area2_to_compare,
 -                                       area1_to_compare, area2_to_compare,
 -                                       snapshot1, snapshot2,
++        compare_heap_area_without_type(state, real_area1_to_compare, real_area2_to_compare, snapshot1, snapshot2,
                                         previous, size, check_ignore);
    }
    if (res_compare == 1) {