From: Marion Guthmuller Date: Wed, 13 Jun 2012 09:57:54 +0000 (+0200) Subject: model-checker : add total hamming distance for heap comparison algorithm X-Git-Tag: v3_8~629^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fd0c81491963b25dab20bce41bdc3a66b5a936d6 model-checker : add total hamming distance for heap comparison algorithm --- diff --git a/src/xbt/mmalloc/mm_diff.c b/src/xbt/mmalloc/mm_diff.c index c7e56c1ec6..9b6de46984 100644 --- a/src/xbt/mmalloc/mm_diff.c +++ b/src/xbt/mmalloc/mm_diff.c @@ -209,6 +209,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap, int k; int distance = 0; + int total_distance = 0; void *end_heap = get_end_addr_heap(s_heap); @@ -334,6 +335,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap, mmalloc_backtrace_block_display(mdp1, i); mmalloc_backtrace_block_display(mdp2, i); errors++; + total_distance += distance; } @@ -450,6 +452,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap, mmalloc_backtrace_fragment_display(mdp1, i, j); mmalloc_backtrace_fragment_display(mdp2, i, j); errors++; + total_distance += distance; } @@ -473,6 +476,8 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap, //free(pointed_address1); //free(pointed_address2); + fprintf(stderr, "Hamming distance between heap regions : %d\n", total_distance); + return (errors); }