Algorithmique Numérique Distribuée Public GIT Repository
 author Marion Guthmuller Tue, 19 Mar 2013 15:39:04 +0000 (16:39 +0100) committer Marion Guthmuller Tue, 19 Mar 2013 18:28:29 +0000 (19:28 +0100)

index 61d7da7..d445697 100644 (file)
@@ -534,7 +534,7 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){ /* Return code
size_t i = 0, pointer_align = 0, ignore1 = 0, ignore2 = 0;
int res_compare;
-  size_t block1, frag1, block2, frag2;
+  ssize_t block1, frag1, block2, frag2;
ssize_t size;
int check_ignore = 0;
int j;
@@ -616,13 +616,22 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){ /* Return code
}

size = heapinfo1[block1].busy_block.busy_size;
+
+      if(size <= 0){
+        if(match_pairs){
+          match_equals(previous);
+          xbt_dynar_free(&previous);
+        }
+        return 0;
+      }
+
frag1 = -1;
frag2 = -1;

-      if(heapinfo1[block1].busy_block.ignore == 1 || heapinfo2[block2].busy_block.ignore == 1)
+      if(heapinfo1[block1].busy_block.ignore == 1 && heapinfo2[block2].busy_block.ignore == 1)
check_ignore = 1;

}else{
@@ -667,7 +676,7 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){ /* Return code

size = heapinfo1[block1].busy_frag.frag_size[frag1];

-      if(size == -1){
+      if(size <= 0){
if(match_pairs){
match_equals(previous);
xbt_dynar_free(&previous);
@@ -675,10 +684,11 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){ /* Return code
return 0;
}

-      if(heapinfo1[block1].busy_frag.ignore[frag1] == 1 || heapinfo2[block2].busy_frag.ignore[frag2] == 1)
+      if(heapinfo1[block1].busy_frag.ignore[frag1] == 1 && heapinfo2[block2].busy_frag.ignore[frag2] == 1)
check_ignore = 1;

}
+
}else if((heapinfo1[block1].type > 0) && (heapinfo2[block2].type > 0)){

frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
@@ -722,14 +732,15 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){ /* Return code

size = heapinfo1[block1].busy_frag.frag_size[frag1];

-    if(size == -1){
+    if(size <= 0){
if(match_pairs){
+        match_equals(previous);
xbt_dynar_free(&previous);
}
return 0;
}

-    if(heapinfo1[block1].busy_frag.ignore[frag1] == 1 || heapinfo2[block2].busy_frag.ignore[frag2] == 1)
+    if(heapinfo1[block1].busy_frag.ignore[frag1] == 1 && heapinfo2[block2].busy_frag.ignore[frag2] == 1)
check_ignore = 1;

}else{