- /* Check busy blocks (circular checking)*/
-
- i = block_free1 + mdp1->heapinfo[block_free1].free.size;
- next_block_free = mdp1->heapinfo[block_free1].free.next;
-
- if(next_block_free == 0)
- next_block_free = mdp1->heaplimit;
-
-
- while(i != first_block_free){
-
- while(i<next_block_free){
-
- j = i;
-
- if(mdp1->heapinfo[i].busy.type != mdp2->heapinfo[i].busy.type){
- XBT_DEBUG("Different type of busy block");
- return 1;
- }else{
- if(i == 0)
- j++;
- mdp = mdp1;
- addr_block1 = ADDRESS(j);
- mdp = mdp2;
- addr_block2 = ADDRESS(j);
- switch(mdp1->heapinfo[i].busy.type){
- case 0 :
- if(mdp1->heapinfo[i].busy.info.size != mdp2->heapinfo[i].busy.info.size){
- XBT_DEBUG("Different size of a large cluster");
- return 1;
- }else{
- if(memcmp(addr_block1, addr_block2, (mdp1->heapinfo[i].busy.info.size * BLOCKSIZE)) != 0){
- XBT_DEBUG("Different data in block %Zu", i);
- return 1;
- }
- }
- i = i+mdp1->heapinfo[i].busy.info.size;
- break;
- default :
- if(mdp1->heapinfo[i].busy.info.frag.nfree != mdp2->heapinfo[i].busy.info.frag.nfree){
- XBT_DEBUG("Different free fragments in a fragmented block");
- return 1;
- }else{
- if(mdp1->heapinfo[i].busy.info.frag.first != mdp2->heapinfo[i].busy.info.frag.first){
- XBT_DEBUG("Different first free fragments of the block");
- return 1;
- }else{
- if(memcmp(addr_block1, addr_block2, BLOCKSIZE) != 0){
- XBT_DEBUG("Different data in fragmented block %Zu", i);
- return 1;
- }
- }
- }
- i++;
- break;
- }
- }
- }
-
-
- block_free1 = mdp1->heapinfo[block_free1].free.next;
- next_block_free = mdp1->heapinfo[block_free1].free.next;
- if(i != first_block_free){
- if(block_free1 != 0)
- i = block_free1 + mdp1->heapinfo[block_free1].free.size;
- else
- i = 0;
- }
-
- }
-
- return 0;
-
-