+ if(state->heapinfo1[block1].busy_block.busy_size != state->heapinfo2[block2].busy_block.busy_size){
+ if(match_pairs){
+ xbt_dynar_free(&previous);
+ }
+ return 1;
+ }
+
+ if(!add_heap_area_pair(previous, block1, -1, block2, -1)){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return 0;
+ }
+
+ size = state->heapinfo1[block1].busy_block.busy_size;
+
+ // Remember (basic) type inference.
+ // The current data structure only allows us to do this for the whole block.
+ if (type != NULL && area1==real_addr_block1) {
+ xbt_free(state->types1[block1][0]);
+ state->types1[block1][0] = type;
+ }
+ if (type != NULL && area2==real_addr_block2) {
+ xbt_free(state->types2[block2][0]);
+ state->types2[block2][0] = type;
+ }
+
+ if(size <= 0){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return 0;
+ }
+
+ frag1 = -1;
+ frag2 = -1;
+
+ area1_to_compare = addr_block1;
+ area2_to_compare = addr_block2;
+
+ if((state->heapinfo1[block1].busy_block.ignore > 0) && (state->heapinfo2[block2].busy_block.ignore == state->heapinfo1[block1].busy_block.ignore))
+ check_ignore = state->heapinfo1[block1].busy_block.ignore;
+
+ }else if((state->heapinfo1[block1].type > 0) && (state->heapinfo2[block2].type > 0)){ /* Fragmented block */
+
+ // Fragment number:
+ frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> state->heapinfo1[block1].type;
+ frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> state->heapinfo2[block2].type;
+
+ // Snapshot address of the fragment:
+ addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << state->heapinfo1[block1].type));
+ addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << state->heapinfo2[block2].type));
+
+ // Process address of the fragment:
+ real_addr_frag1 = (void*) ((char *)real_addr_block1 + (frag1 << ((xbt_mheap_t)state->s_heap)->heapinfo[block1].type));
+ real_addr_frag2 = (void*) ((char *)real_addr_block2 + (frag2 << ((xbt_mheap_t)state->s_heap)->heapinfo[block2].type));
+
+ // Check the size of the fragments against the size of the type:
+ if(type_size != -1){
+ if(state->heapinfo1[block1].busy_frag.frag_size[frag1] == -1 || state->heapinfo2[block2].busy_frag.frag_size[frag2] == -1){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return -1;
+ }
+ if(type_size != state->heapinfo1[block1].busy_frag.frag_size[frag1]|| type_size != state->heapinfo2[block2].busy_frag.frag_size[frag2]){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return -1;
+ }
+ }
+
+ // Check if the blocks are already matched together:
+ if(state->equals_to1[block1][frag1] != NULL && state->equals_to2[block2][frag2] != NULL){
+ if(equal_fragments(state, block1, frag1, block2, frag2)){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return 0;
+ }
+ }
+
+ // Compare the size of both fragments:
+ if(state->heapinfo1[block1].busy_frag.frag_size[frag1] != state->heapinfo2[block2].busy_frag.frag_size[frag2]){
+ if(type_size == -1){
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return -1;
+ }else{
+ if(match_pairs){
+ xbt_dynar_free(&previous);
+ }