From: Marion Guthmuller Date: Fri, 17 Aug 2012 07:55:59 +0000 (+0200) Subject: model-checker : try first to associate each block or fragment with the same positiion... X-Git-Tag: v3_9_rc1~86^2~237^2~25 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e6bb6ef3c68e10a9db83a45a770e391f95bc827d model-checker : try first to associate each block or fragment with the same positiion in the other heap --- diff --git a/src/xbt/mmalloc/mm_diff.c b/src/xbt/mmalloc/mm_diff.c index e782907cc9..00a845f116 100644 --- a/src/xbt/mmalloc/mm_diff.c +++ b/src/xbt/mmalloc/mm_diff.c @@ -304,6 +304,48 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac } + if(heapinfo1[i1].busy_block.busy_size == 0){ + i1++; + continue; + } + + i2 = 1; + equal = 0; + + /* Try first to associate to same block in the other heap */ + if(heapinfo2[current_block].type == heapinfo1[current_block].type){ + + if(heapinfo1[current_block].busy_block.busy_size == heapinfo2[current_block].busy_block.busy_size){ + + addr_block2 = ((void*) (((ADDR2UINT(current_block)) - 1) * BLOCKSIZE + (char*)heapbase2)); + + add_heap_area_pair(previous, current_block, -1, current_block, -1); + + if(ignore_done < xbt_dynar_length(mmalloc_ignore)){ + if(in_mmalloc_ignore((int)current_block, -1)) + res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 1); + else + res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 0); + }else{ + res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 0); + } + + if(res_compare == 0){ + for(k=1; k < heapinfo2[current_block].busy_block.size; k++) + heapinfo2[current_block+k].busy_block.equal_to = 1 ; + for(k=1; k < heapinfo1[current_block].busy_block.size; k++) + heapinfo1[current_block+k].busy_block.equal_to = 1 ; + equal = 1; + match_equals(previous); + i1 = i1 + heapinfo1[i1].busy_block.size; + } + + xbt_dynar_reset(previous); + + } + + } + while(i2 <= heaplimit && !equal){ addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)heapbase2));