From: Martin Quinson Date: Thu, 2 Feb 2012 20:44:21 +0000 (+0100) Subject: TODO--: the 'type' of each mmalloc block is granted to be uptodate at every point X-Git-Tag: exp_20120216~73 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/76936ddebd0a514a3259454d475b254ce40947b3?hp=00255adf47970918999b2b4495ce8a69b036e68a;ds=sidebyside TODO--: the 'type' of each mmalloc block is granted to be uptodate at every point Tomorrow, I'll add the fragment metadatas, and the backtraces. For that, I'll waste a lot of space by adding a static tables to the malloc_info structure, where the size of that table is the maximal amount of fragments per block. Something like BLOCKSIZE/sizeof(struct list) since mmalloc refuses to allocate smaller blocks (to ensure that we can enlist free fragments). This implementation of malloc will definitely not be something that you want to use when not forced to do so to get the model-checking working. But it will provide all the information that MC needs. --- diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 8352e13379..423c57f5a6 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -95,17 +95,10 @@ const char *xbt_thread_self_name(void); * When looking for free blocks, we traverse the mdp->heapinfo looking * for a cluster of free blocks that would be large enough. * - * The size of the cluster is only to be trusted in the first block of the cluster. - * If the cluster results of the fusion of several clusters, the previously first - * block of their cluster will have partial data. The only information kept consistent over - * all blocks of the clusters is their type (== -1). + * The size of the cluster is only to be trusted in the first block of the cluster, not in the middle blocks. * - * Note that there is no way to determine if the block is free or busy by exploring - * this structure only. It wasn't intended to be crawled for comparison and we should fix it (TODO). - * - * TODO: understand whether the information are written in each blocks of a cluster (be it - * free or busy) or only in the first block of the cluster. And in the latter case, how can - * I retrieve the first block of my cluster. + * The type field is consistently updated for every blocks, even within clusters of blocks. + * You can crawl the array and rely on that value. * * TODO: * - add an indication of the requested size in each fragment, similarly to busy_block.busy_size