X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9af5d6fa719c7b91b887ad7fb6ccaf9a3313a89..0e13f3fc6dd94981d4ac61482f36e3e67cb84eac:/src/xbt/mmalloc/mmprivate.h diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 69a6a75178..09cb4be8b2 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -122,6 +122,11 @@ typedef struct s_heap_area_pair{ int fragment2; }s_heap_area_pair_t, *heap_area_pair_t; +#define MMALLOC_TYPE_HEAPINFO (-2) +#define MMALLOC_TYPE_FREE (-1) +#define MMALLOC_TYPE_UNFRAGMENTED 0 +/* >0 values are fragmented blocks */ + /* Data structure giving per-block information. * * There is one such structure in the mdp->heapinfo array per block used in that heap, @@ -303,4 +308,16 @@ static XBT_INLINE void mmalloc_paranoia(struct mdesc *mdp){ } +static inline int mmalloc_get_increment(malloc_info* heapinfo) { + if (heapinfo->type < 0) { + return heapinfo->free_block.size; + } else if (heapinfo->type == 0) { + return heapinfo->busy_block.size; + } else { + return 1; + } +} + +void mmcheck(xbt_mheap_t heap); + #endif /* __MMPRIVATE_H */