From: Gabriel Corona Date: Tue, 8 Jul 2014 11:43:29 +0000 (+0200) Subject: Merge branch 'mc-fix' into mc-fastsnapshot X-Git-Tag: v3_12~890^2~1^2~4^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df6f01f7876ff2b5dc12e3eeee31e963955f3d68 Merge branch 'mc-fix' into mc-fastsnapshot Conflicts: src/mc/mc_diff.c --- df6f01f7876ff2b5dc12e3eeee31e963955f3d68 diff --cc src/mc/mc_diff.c index 336897df29,e68d72e843..d465400d41 --- a/src/mc/mc_diff.c +++ b/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, @@@ -618,8 -628,7 +617,7 @@@ (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; @@@ -1135,11 -1191,11 +1132,14 @@@ int match_pairs = 0; + 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; - 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); + if (previous == NULL) { previous = xbt_dynar_new(sizeof(heap_area_pair_t), heap_area_pair_free_voidp); @@@ -1230,9 -1290,9 +1233,9 @@@ } 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); @@@ -1303,12 -1373,10 +1306,10 @@@ // 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) { @@@ -1320,8 -1388,10 +1321,9 @@@ } 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); @@@ -1356,11 -1427,12 +1359,12 @@@ 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; } @@@ -1471,12 -1543,16 +1475,12 @@@ /* 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) {