- i = first_block_free + mdp1->heapinfo[first_block_free].free.size;
-
- if(mdp1->heapinfo[first_block_free].free.next != mdp2->heapinfo[first_block_free].free.next){
- XBT_DEBUG("Different next block free");
- return 1;
- }
-
- block_free = first_block_free;
- next_block_free = mdp1->heapinfo[first_block_free].free.next;
-
- //XBT_DEBUG("First block free : %zu (size=%zu), Next block free : %zu", first_block_free, mdp1->heapinfo[block_free1].free.size, next_block_free);
-
- if(next_block_free == 0)
- next_block_free = mdp1->heaplimit;
-
-
- while(i != first_block_free){
-
- while(i<next_block_free){
-
- if(mdp1->heapinfo[i].busy.type != mdp2->heapinfo[i].busy.type){
- XBT_DEBUG("Different type of busy block");
- return 1;
- }else{
-
- addr_block1 = (char *)mdp1 + sizeof(struct mdesc) + ((i-1) * BLOCKSIZE);
- addr_block2 = (char *)mdp2 + sizeof(struct mdesc) + ((i-1) * BLOCKSIZE);
-
- 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 the fragmented block %zu", i);
- return 1;
- }else{
- if(mdp1->heapinfo[i].busy.info.frag.first != mdp2->heapinfo[i].busy.info.frag.first){
- XBT_DEBUG("Different first free fragments in the block %zu", i);
- return 1;
- }else{
- frag_size = pow(2,mdp1->heapinfo[i].busy.type);
- for(j=0 ; j< (BLOCKSIZE/frag_size); j++){
- if(memcmp((char *)addr_block1 + (j * frag_size), (char *)addr_block2 + (j * frag_size), frag_size) != 0){
- XBT_DEBUG("Different data in fragment %d of block %zu", j + 1, i);
- return 1;
- }
- }
- }
- }
- i++;
- break;
- }
-
- }
- }
-
- if(mdp1->heapinfo[block_free].free.next != mdp2->heapinfo[block_free].free.next){
- XBT_DEBUG("Different next block free");
- return 1;
- }
-
- block_free = mdp1->heapinfo[block_free].free.next;
- next_block_free = mdp1->heapinfo[block_free].free.next;
- if(i != first_block_free){
- if(block_free != 0){
- if(mdp1->heapinfo[block_free].free.size != mdp2->heapinfo[block_free].free.size){
- XBT_DEBUG("Different size of block free");
- return 1;
- }
- i = block_free + mdp1->heapinfo[block_free].free.size;
- }else{
- i = 1;
- }
- }
-
- }
-
- return 0;
-
-