static int is_stack(void *address);
static int is_block_stack(int block);
static int equal_blocks(int b1, int b2);
+static int equal_fragments(int b1, int f1, int b2, int f2);
void mmalloc_backtrace_block_display(void* heapinfo, int block){
to_ignore1 = i1;
to_ignore2 = i2;
+
+ if(MC_is_active()){
+ MC_ignore_data_bss(&heaplimit, sizeof(heaplimit));
+ MC_ignore_data_bss(&s_heap, sizeof(s_heap));
+ MC_ignore_data_bss(&heapbase1, sizeof(heapbase1));
+ MC_ignore_data_bss(&heapbase2, sizeof(heapbase2));
+ MC_ignore_data_bss(&heapinfo1, sizeof(heapinfo1));
+ MC_ignore_data_bss(&heapinfo2, sizeof(heapinfo2));
+ MC_ignore_data_bss(&heapsize1, sizeof(heapsize1));
+ MC_ignore_data_bss(&heapsize2, sizeof(heapsize2));
+ MC_ignore_data_bss(&to_ignore1, sizeof(to_ignore1));
+ MC_ignore_data_bss(&to_ignore2, sizeof(to_ignore2));
+ }
}
frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
+ if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL){
+ if(equal_fragments(block1, frag1, block2, frag2)){
+ return 0;
+ }
+ }
+
if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2])
return 1;
if(!add_heap_area_pair(previous, block1, frag1, block2, frag2))
frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
+ if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL){
+ if(equal_fragments(block1, frag1, block2, frag2)){
+ return 0;
+ }
+ }
+
if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2])
return 1;
if(!add_heap_area_pair(previous, block1, frag1, block2, frag2))
}
static void heap_area_pair_free(heap_area_pair_t pair){
- if (pair){
- xbt_free(pair);
- pair = NULL;
- }
+ xbt_free(pair);
+ pair = NULL;
}
static void heap_area_pair_free_voidp(void *d)
}
-static int equal_blocks(b1, b2){
+static int equal_blocks(int b1, int b2){
if(heapinfo1[b1].busy_block.equal_to != NULL){
if(heapinfo2[b2].busy_block.equal_to != NULL){
if(((heap_area_t)(heapinfo1[b1].busy_block.equal_to))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_block.equal_to))->block == b1)
}
return 0;
}
+
+static int equal_fragments(int b1, int f1, int b2, int f2){
+ if(heapinfo1[b1].busy_frag.equal_to[f1] != NULL){
+ if(heapinfo2[b2].busy_frag.equal_to[f2] != NULL){
+ if(((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->block == b1 && ((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->fragment == f2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->fragment == f1)
+ return 1;
+ }
+ }
+ return 0;
+}