From 7e02819630f97eb2bd43ff422d156cc8a60929c5 Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Fri, 9 Nov 2012 18:33:19 +0100 Subject: [PATCH] model-checker : getter function for chunks used in heap --- include/xbt/mmalloc.h | 2 ++ src/xbt/mmalloc/mm_module.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/xbt/mmalloc.h b/include/xbt/mmalloc.h index 74904083c6..e3b5b10807 100644 --- a/include/xbt/mmalloc.h +++ b/include/xbt/mmalloc.h @@ -70,6 +70,8 @@ void mmalloc_backtrace_display(void *addr); int is_free_area(void *area, xbt_mheap_t heap); +size_t mmalloc_get_chunks_used(xbt_mheap_t); + #endif /* MMALLOC_H */ diff --git a/src/xbt/mmalloc/mm_module.c b/src/xbt/mmalloc/mm_module.c index cd4ef278da..de1942a764 100644 --- a/src/xbt/mmalloc/mm_module.c +++ b/src/xbt/mmalloc/mm_module.c @@ -339,3 +339,7 @@ void mmalloc_postexit(void) // mmalloc_detach(__mmalloc_default_mdp); xbt_mheap_destroy_no_free(__mmalloc_default_mdp); } + +size_t mmalloc_get_chunks_used(xbt_mheap_t heap){ + return ((struct mdesc *)heap)->heapstats.chunks_used; +} -- 2.20.1