From: Marion Guthmuller Date: Tue, 28 Feb 2012 09:29:50 +0000 (+0100) Subject: model-checker : add backtrace for each fragment allocated with mmalloc X-Git-Tag: exp_20120308~20 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/60dfbf03645430333993376b5bc0f567ec417b38?ds=sidebyside model-checker : add backtrace for each fragment allocated with mmalloc --- diff --git a/src/xbt/mmalloc/mmalloc.c b/src/xbt/mmalloc/mmalloc.c index b13412bca7..bbdc9375f9 100644 --- a/src/xbt/mmalloc/mmalloc.c +++ b/src/xbt/mmalloc/mmalloc.c @@ -153,7 +153,7 @@ void *mmalloc(xbt_mheap_t mdp, size_t size) frag_nb = RESIDUAL(result, BLOCKSIZE) >> log; mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = requested_size; - //FIXME setup backtrace + xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[frag_nb],XBT_BACKTRACE_SIZE); next->prev->next = next->next; if (next->next != NULL) { @@ -184,8 +184,8 @@ void *mmalloc(xbt_mheap_t mdp, size_t size) } } mdp->heapinfo[block].busy_frag.frag_size[0] = requested_size; - // FIXME: setup backtrace - + xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE); + /* Initialize the nfree and first counters for this block. */ mdp->heapinfo[block].type = log; mdp->heapinfo[block].busy_frag.nfree = i - 1; diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 507a27d0d5..2298c27ee7 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -131,7 +131,7 @@ typedef struct { size_t nfree; /* Free fragments in a fragmented block. */ size_t first; /* First free fragment of the block. */ unsigned short frag_size[MAX_FRAGMENT_PER_BLOCK]; - //void *bt[XBT_BACKTRACE_SIZE][MAX_FRAGMENT_PER_BLOCK]; /* Where it was malloced (or realloced lastly) */ + void *bt[MAX_FRAGMENT_PER_BLOCK][XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */ } busy_frag; struct { size_t size; /* Size (in blocks) of a large cluster. */