From c59fb90ea83ce58355bc388b1a5ebaef96420806 Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Mon, 7 Jan 2013 13:56:08 +0100 Subject: [PATCH] model-checker : comment backtrace and add ignore mechanism in mmalloc metadata --- src/mc/mc_global.c | 2 + src/xbt/mmalloc/mfree.c | 6 +- src/xbt/mmalloc/mm_diff.c | 184 ++++++++++++++++-------------------- src/xbt/mmalloc/mmalloc.c | 16 +++- src/xbt/mmalloc/mmprivate.h | 8 +- 5 files changed, 105 insertions(+), 111 deletions(-) diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index cdc4cd1e99..6cd26b852d 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -752,8 +752,10 @@ void MC_ignore_heap(void *address, size_t size){ if(((xbt_mheap_t)std_heap)->heapinfo[region->block].type == 0){ region->fragment = -1; + ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_block.ignore = 1; }else{ region->fragment = ((uintptr_t) (ADDR2UINT (address) % (BLOCKSIZE))) >> ((xbt_mheap_t)std_heap)->heapinfo[region->block].type; + ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_frag.ignore[region->fragment] = 1; } } diff --git a/src/xbt/mmalloc/mfree.c b/src/xbt/mmalloc/mfree.c index b11e21e680..e9031ebdf6 100644 --- a/src/xbt/mmalloc/mfree.c +++ b/src/xbt/mmalloc/mfree.c @@ -157,7 +157,8 @@ void mfree(struct mdesc *mdp, void *ptr) /* Set size used in the fragment to -1 */ mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1; - + mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0; + // fprintf(stderr,"nfree:%zu capa:%d\n", mdp->heapinfo[block].busy_frag.nfree,(BLOCKSIZE >> type)); if (mdp->heapinfo[block].busy_frag.nfree == (BLOCKSIZE >> type) - 1) { @@ -168,7 +169,8 @@ void mfree(struct mdesc *mdp, void *ptr) mdp->heapinfo[block].type = 0; mdp->heapinfo[block].busy_block.size = 1; mdp->heapinfo[block].busy_block.busy_size = 0; - + mdp->heapinfo[block].busy_block.ignore = 0; + /* Keep the statistics accurate. */ mdp -> heapstats.chunks_used++; mdp -> heapstats.bytes_used += BLOCKSIZE; diff --git a/src/xbt/mmalloc/mm_diff.c b/src/xbt/mmalloc/mm_diff.c index e19bd95970..6dda1cce6d 100644 --- a/src/xbt/mmalloc/mm_diff.c +++ b/src/xbt/mmalloc/mm_diff.c @@ -34,82 +34,82 @@ static char* is_stack(void *address); void mmalloc_backtrace_block_display(void* heapinfo, int block){ - xbt_ex_t e; - - if (((malloc_info *)heapinfo)[block].busy_block.bt_size == 0) { - fprintf(stderr, "No backtrace available for that block, sorry.\n"); - return; - } - - memcpy(&e.bt,&(((malloc_info *)heapinfo)[block].busy_block.bt),sizeof(void*)*XBT_BACKTRACE_SIZE); - e.used = ((malloc_info *)heapinfo)[block].busy_block.bt_size; - - xbt_ex_setup_backtrace(&e); - if (e.used == 0) { - fprintf(stderr, "(backtrace not set)\n"); - } else if (e.bt_strings == NULL) { - fprintf(stderr, "(backtrace not ready to be computed. %s)\n",xbt_binary_name?"Dunno why":"xbt_binary_name not setup yet"); - } else { - int i; - - fprintf(stderr, "Backtrace of where the block %d was malloced (%d frames):\n", block ,e.used); - for (i = 0; i < e.used; i++) /* no need to display "xbt_backtrace_display" */{ - fprintf(stderr, "%d ---> %s\n",i, e.bt_strings[i] + 4); - } - } + /* xbt_ex_t e; */ + + /* if (((malloc_info *)heapinfo)[block].busy_block.bt_size == 0) { */ + /* fprintf(stderr, "No backtrace available for that block, sorry.\n"); */ + /* return; */ + /* } */ + + /* memcpy(&e.bt,&(((malloc_info *)heapinfo)[block].busy_block.bt),sizeof(void*)*XBT_BACKTRACE_SIZE); */ + /* e.used = ((malloc_info *)heapinfo)[block].busy_block.bt_size; */ + + /* xbt_ex_setup_backtrace(&e); */ + /* if (e.used == 0) { */ + /* fprintf(stderr, "(backtrace not set)\n"); */ + /* } else if (e.bt_strings == NULL) { */ + /* fprintf(stderr, "(backtrace not ready to be computed. %s)\n",xbt_binary_name?"Dunno why":"xbt_binary_name not setup yet"); */ + /* } else { */ + /* int i; */ + + /* fprintf(stderr, "Backtrace of where the block %d was malloced (%d frames):\n", block ,e.used); */ + /* for (i = 0; i < e.used; i++) /\* no need to display "xbt_backtrace_display" *\/{ */ + /* fprintf(stderr, "%d ---> %s\n",i, e.bt_strings[i] + 4); */ + /* } */ + /* } */ } void mmalloc_backtrace_fragment_display(void* heapinfo, int block, int frag){ - xbt_ex_t e; + /* xbt_ex_t e; */ - memcpy(&e.bt,&(((malloc_info *)heapinfo)[block].busy_frag.bt[frag]),sizeof(void*)*XBT_BACKTRACE_SIZE); - e.used = XBT_BACKTRACE_SIZE; + /* memcpy(&e.bt,&(((malloc_info *)heapinfo)[block].busy_frag.bt[frag]),sizeof(void*)*XBT_BACKTRACE_SIZE); */ + /* e.used = XBT_BACKTRACE_SIZE; */ - xbt_ex_setup_backtrace(&e); - if (e.used == 0) { - fprintf(stderr, "(backtrace not set)\n"); - } else if (e.bt_strings == NULL) { - fprintf(stderr, "(backtrace not ready to be computed. %s)\n",xbt_binary_name?"Dunno why":"xbt_binary_name not setup yet"); - } else { - int i; + /* xbt_ex_setup_backtrace(&e); */ + /* if (e.used == 0) { */ + /* fprintf(stderr, "(backtrace not set)\n"); */ + /* } else if (e.bt_strings == NULL) { */ + /* fprintf(stderr, "(backtrace not ready to be computed. %s)\n",xbt_binary_name?"Dunno why":"xbt_binary_name not setup yet"); */ + /* } else { */ + /* int i; */ - fprintf(stderr, "Backtrace of where the fragment %d in block %d was malloced (%d frames):\n", frag, block ,e.used); - for (i = 0; i < e.used; i++) /* no need to display "xbt_backtrace_display" */{ - fprintf(stderr, "%d ---> %s\n",i, e.bt_strings[i] + 4); - } - } + /* fprintf(stderr, "Backtrace of where the fragment %d in block %d was malloced (%d frames):\n", frag, block ,e.used); */ + /* for (i = 0; i < e.used; i++) /\* no need to display "xbt_backtrace_display" *\/{ */ + /* fprintf(stderr, "%d ---> %s\n",i, e.bt_strings[i] + 4); */ + /* } */ + /* } */ } void mmalloc_backtrace_display(void *addr){ - size_t block, frag_nb; - int type; + /* size_t block, frag_nb; */ + /* int type; */ - xbt_mheap_t heap = __mmalloc_current_heap ?: (xbt_mheap_t) mmalloc_preinit(); - - block = (((char*) (addr) - (char*) heap -> heapbase) / BLOCKSIZE + 1); - - type = heap->heapinfo[block].type; - - switch(type){ - case -1 : /* Free block */ - fprintf(stderr, "Asked to display the backtrace of a block that is free. I'm puzzled\n"); - xbt_abort(); - break; - case 0: /* Large block */ - mmalloc_backtrace_block_display(heap->heapinfo, block); - break; - default: /* Fragmented block */ - frag_nb = RESIDUAL(addr, BLOCKSIZE) >> type; - if(heap->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){ - fprintf(stderr , "Asked to display the backtrace of a fragment that is free. I'm puzzled\n"); - xbt_abort(); - } - mmalloc_backtrace_fragment_display(heap->heapinfo, block, frag_nb); - break; - } + /* xbt_mheap_t heap = __mmalloc_current_heap ?: (xbt_mheap_t) mmalloc_preinit(); */ + + /* block = (((char*) (addr) - (char*) heap -> heapbase) / BLOCKSIZE + 1); */ + + /* type = heap->heapinfo[block].type; */ + + /* switch(type){ */ + /* case -1 : /\* Free block *\/ */ + /* fprintf(stderr, "Asked to display the backtrace of a block that is free. I'm puzzled\n"); */ + /* xbt_abort(); */ + /* break; */ + /* case 0: /\* Large block *\/ */ + /* mmalloc_backtrace_block_display(heap->heapinfo, block); */ + /* break; */ + /* default: /\* Fragmented block *\/ */ + /* frag_nb = RESIDUAL(addr, BLOCKSIZE) >> type; */ + /* if(heap->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){ */ + /* fprintf(stderr , "Asked to display the backtrace of a fragment that is free. I'm puzzled\n"); */ + /* xbt_abort(); */ + /* } */ + /* mmalloc_backtrace_fragment_display(heap->heapinfo, block, frag_nb); */ + /* break; */ + /* } */ } @@ -247,11 +247,8 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac add_heap_area_pair(previous, current_block, -1, current_block, -1); if(res_compare != -1){ - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore((int)current_block, -1)) - res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 1); - else - res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && heapinfo1[current_block].busy_block.ignore == 1){ + res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 1); }else{ res_compare = compare_area(addr_block1, addr_block2, heapinfo1[current_block].busy_block.busy_size, previous, 0); } @@ -318,11 +315,8 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac add_heap_area_pair(previous, i1, -1, i2, -1); if(res_compare != -1){ - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore((int)i1, -1)) - res_compare = compare_area(addr_block1, addr_block2, heapinfo1[i1].busy_block.busy_size, previous, 1); - else - res_compare = compare_area(addr_block1, addr_block2, heapinfo1[i1].busy_block.busy_size, previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && heapinfo1[i1].busy_block.ignore == 1){ + res_compare = compare_area(addr_block1, addr_block2, heapinfo1[i1].busy_block.busy_size, previous, 1); }else{ res_compare = compare_area(addr_block1, addr_block2, heapinfo1[i1].busy_block.busy_size, previous, 0); } @@ -376,11 +370,8 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac add_heap_area_pair(previous, current_block, current_fragment, current_block, current_fragment); - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore((int)current_block, (int)current_fragment)) - res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[current_block].busy_frag.frag_size[current_fragment], previous, 1); - else - res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[current_block].busy_frag.frag_size[current_fragment], previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && (heapinfo1[current_block].busy_frag.ignore[current_fragment] == 1)){ + res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[current_block].busy_frag.frag_size[current_fragment], previous, 1); }else{ res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[current_block].busy_frag.frag_size[current_fragment], previous, 0); } @@ -422,11 +413,8 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac /* Comparison */ add_heap_area_pair(previous, i1, j1, i2, j2); - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore((int)i1, (int)j1)) - res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[i1].busy_frag.frag_size[j1], previous, 1); - else - res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[i1].busy_frag.frag_size[j1], previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && (heapinfo1[i1].busy_frag.ignore[j1] == 1)){ + res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[i1].busy_frag.frag_size[j1], previous, 1); }else{ res_compare = compare_area(addr_frag1, addr_frag2, heapinfo1[i1].busy_frag.frag_size[j1], previous, 0); } @@ -464,7 +452,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase1)); XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block1, heapinfo1[i].busy_block.busy_size); - mmalloc_backtrace_block_display((void*)heapinfo1, i); + //mmalloc_backtrace_block_display((void*)heapinfo1, i); } nb_diff1++; }else{ @@ -480,7 +468,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_frag1 = (void*) ((char *)addr_block1 + (j << heapinfo1[i].type)); XBT_DEBUG("Block %zu, Fragment %zu (%p) not found (size used = %d)", i, j, addr_frag1, heapinfo1[i].busy_frag.frag_size[j]); - mmalloc_backtrace_fragment_display((void*)heapinfo1, i, j); + //mmalloc_backtrace_fragment_display((void*)heapinfo1, i, j); } nb_diff1++; }else{ @@ -504,7 +492,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase2)); XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block2, heapinfo2[i].busy_block.busy_size); - mmalloc_backtrace_block_display((void*)heapinfo2, i); + //mmalloc_backtrace_block_display((void*)heapinfo2, i); } nb_diff2++; }else{ @@ -520,7 +508,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t *stac if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_frag2 = (void*) ((char *)addr_block2 + (j << heapinfo2[i].type)); XBT_DEBUG( "Block %zu, Fragment %zu (%p) not found (size used = %d)", i, j, addr_frag2, heapinfo2[i].busy_frag.frag_size[j]); - mmalloc_backtrace_fragment_display((void*)heapinfo2, i, j); + //mmalloc_backtrace_fragment_display((void*)heapinfo2, i, j); } nb_diff2++; }else{ @@ -655,11 +643,8 @@ static int compare_area(void *area1, void* area2, size_t size, xbt_dynar_t previ if(add_heap_area_pair(previous, block_pointed1, -1, block_pointed2, -1)){ - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore(block_pointed1, -1)) - res_compare = compare_area(addr_block_pointed1, addr_block_pointed2, heapinfo1[block_pointed1].busy_block.busy_size, previous, 1); - else - res_compare = compare_area(addr_block_pointed1, addr_block_pointed2, heapinfo1[block_pointed1].busy_block.busy_size, previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && (heapinfo1[block_pointed1].busy_block.ignore == 1)){ + res_compare = compare_area(addr_block_pointed1, addr_block_pointed2, heapinfo1[block_pointed1].busy_block.busy_size, previous, 1); }else{ res_compare = compare_area(addr_block_pointed1, addr_block_pointed2, heapinfo1[block_pointed1].busy_block.busy_size, previous, 0); } @@ -683,11 +668,11 @@ static int compare_area(void *area1, void* area2, size_t size, xbt_dynar_t previ if(add_heap_area_pair(previous, block_pointed1, frag_pointed1, block_pointed2, frag_pointed2)){ - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore(block_pointed1, frag_pointed1)) + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && (heapinfo1[block_pointed1].busy_frag.ignore[frag_pointed1] == 1)){ + //if(in_mc_comparison_ignore(block_pointed1, frag_pointed1)) res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 1); - else - res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 0); + /*else + res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 0);*/ }else{ res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 0); } @@ -717,11 +702,8 @@ static int compare_area(void *area1, void* area2, size_t size, xbt_dynar_t previ if(add_heap_area_pair(previous, block_pointed1, frag_pointed1, block_pointed2, frag_pointed2)){ - if(ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)){ - if(in_mc_comparison_ignore(block_pointed1, frag_pointed1)) - res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 1); - else - res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 0); + if((ignore_done < xbt_dynar_length(mc_heap_comparison_ignore)) && (heapinfo1[block_pointed1].busy_frag.ignore[frag_pointed1] == 1)){ + res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 1); }else{ res_compare = compare_area(addr_frag_pointed1, addr_frag_pointed2, heapinfo1[block_pointed1].busy_frag.frag_size[frag_pointed1], previous, 0); } diff --git a/src/xbt/mmalloc/mmalloc.c b/src/xbt/mmalloc/mmalloc.c index 89d1ec614d..726842fa32 100644 --- a/src/xbt/mmalloc/mmalloc.c +++ b/src/xbt/mmalloc/mmalloc.c @@ -122,7 +122,8 @@ static void *register_morecore(struct mdesc *mdp, size_t size) newinfo[BLOCK(oldinfo)].busy_block.size = BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); newinfo[BLOCK(oldinfo)].busy_block.busy_size = size; - newinfo[BLOCK(oldinfo)].busy_block.bt_size = 0;// FIXME setup the backtrace + newinfo[BLOCK(oldinfo)].busy_block.ignore = 0; + //newinfo[BLOCK(oldinfo)].busy_block.bt_size = 0;// FIXME setup the backtrace mfree(mdp, (void *) oldinfo); mdp->heapsize = newsize; } @@ -201,7 +202,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) /* Update our metadata about this fragment */ candidate_info->busy_frag.frag_size[candidate_frag] = requested_size; - xbt_backtrace_no_malloc(candidate_info->busy_frag.bt[candidate_frag],XBT_BACKTRACE_SIZE); + candidate_info->busy_frag.ignore[candidate_frag] = 0; + //xbt_backtrace_no_malloc(candidate_info->busy_frag.bt[candidate_frag],XBT_BACKTRACE_SIZE); /* Update the statistics. */ mdp -> heapstats.chunks_used++; @@ -220,6 +222,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) /* Link all fragments but the first as free, and add the block to the swag of blocks containing free frags */ for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) { mdp->heapinfo[block].busy_frag.frag_size[i] = -1; + mdp->heapinfo[block].busy_frag.ignore[i] = 0; } mdp->heapinfo[block].busy_frag.nfree = i - 1; mdp->heapinfo[block].freehook.prev = NULL; @@ -229,7 +232,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) /* mark the fragment returned as busy */ mdp->heapinfo[block].busy_frag.frag_size[0] = requested_size; - xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE); + mdp->heapinfo[block].busy_frag.ignore[0] = 0; + //xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE); /* update stats */ mdp -> heapstats.chunks_free += (BLOCKSIZE >> log) - 1; @@ -276,7 +280,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) } mdp->heapinfo[block].busy_block.size = blocks; mdp->heapinfo[block].busy_block.busy_size = requested_size; - mdp->heapinfo[block].busy_block.bt_size=xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); + //mdp->heapinfo[block].busy_block.bt_size=xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); + mdp->heapinfo[block].busy_block.ignore = 0; mdp -> heapstats.chunks_used++; mdp -> heapstats.bytes_used += blocks * BLOCKSIZE; @@ -314,8 +319,9 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) } mdp->heapinfo[block].busy_block.size = blocks; mdp->heapinfo[block].busy_block.busy_size = requested_size; + mdp->heapinfo[block].busy_block.ignore = 0; //mdp->heapinfo[block].busy_block.bt_size = 0; - mdp->heapinfo[block].busy_block.bt_size = xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); + //mdp->heapinfo[block].busy_block.bt_size = xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); mdp -> heapstats.chunks_used++; mdp -> heapstats.bytes_used += blocks * BLOCKSIZE; diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 26feb7d962..8eeadaafa1 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -155,14 +155,16 @@ typedef struct { struct { size_t nfree; /* Free fragments in a fragmented block. */ short frag_size[MAX_FRAGMENT_PER_BLOCK]; - void *bt[MAX_FRAGMENT_PER_BLOCK][XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */ + //void *bt[MAX_FRAGMENT_PER_BLOCK][XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */ + int ignore[MAX_FRAGMENT_PER_BLOCK]; heap_area_t equal_to[MAX_FRAGMENT_PER_BLOCK]; } busy_frag; struct { size_t size; /* Size (in blocks) of a large cluster. */ size_t busy_size; /* Actually used space, in bytes */ - void *bt[XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */ - int bt_size; + //void *bt[XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */ + //int bt_size; + int ignore; heap_area_t equal_to; } busy_block; /* Heap information for a free block (that may be the first of a free cluster). */ -- 2.20.1