From: Marion Guthmuller Date: Wed, 13 Jun 2012 15:21:29 +0000 (+0200) Subject: model-checker : fix std_heap address for heap comparison algorithm X-Git-Tag: v3_8~622 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/32417005181718d147397265dff392af44eedc3b model-checker : fix std_heap address for heap comparison algorithm --- diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 3073498062..4b34fd6733 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -15,6 +15,7 @@ #include "simgrid/modelchecker.h" /* our public interface (and definition of HAVE_MC) */ #include "xbt/automaton.h" +#define STD_HEAP_SIZE 20480000 /* Maximum size of the system's heap */ SG_BEGIN_DECL() diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index a64ca64675..b088e88ff4 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -137,7 +137,7 @@ void MC_print_statistics_pairs(mc_stats_pair_t); extern void *std_heap; extern void *raw_heap; -#define STD_HEAP_SIZE 20480000 /* Maximum size of the system's heap */ + /* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */ /* an API to query about the status of a heap, we simply call mmstats and */ diff --git a/src/xbt/mmalloc/mm_diff.c b/src/xbt/mmalloc/mm_diff.c index 6e54a5d2f1..4c37c9ea07 100644 --- a/src/xbt/mmalloc/mm_diff.c +++ b/src/xbt/mmalloc/mm_diff.c @@ -7,6 +7,7 @@ #include "xbt/ex_interface.h" /* internals of backtrace setup */ #include "xbt/str.h" +#include "mc/mc.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mm_diff, xbt, "Logging specific to mm_diff in mmalloc"); @@ -197,7 +198,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2){ //void* heapbase1 = (char *)mdp1 + ((char *)mdp1->heapbase - (char *)s_heap); //void* heapbase2 = (char *)mdp2 + ((char *)mdp2->heapbase - (char *)s_heap); - xbt_mheap_t s_heap = mmalloc_get_current_heap(); + void* s_heap = (char *)mmalloc_get_current_heap() - STD_HEAP_SIZE - getpagesize(); void *heapbase1 = (char *)mdp1 + BLOCKSIZE; void *heapbase2 = (char *)mdp2 + BLOCKSIZE;