Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : add total hamming distance for heap comparison algorithm
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 13 Jun 2012 09:57:54 +0000 (11:57 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 13 Jun 2012 09:57:54 +0000 (11:57 +0200)
src/xbt/mmalloc/mm_diff.c

index c7e56c1..9b6de46 100644 (file)
@@ -209,6 +209,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap,
 
   int k;
   int distance = 0;
 
   int k;
   int distance = 0;
+  int total_distance = 0;
 
   void *end_heap = get_end_addr_heap(s_heap);
 
 
   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++; 
        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++;
              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);
 
   //free(pointed_address1);
   //free(pointed_address2);
 
+  fprintf(stderr, "Hamming distance between heap regions : %d\n", total_distance);
+
   return (errors);
 }
 
   return (errors);
 }