From: Christophe ThiƩry Date: Wed, 20 Apr 2011 16:18:18 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid X-Git-Tag: v3_6_rc3~130^2^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/30ab48e9e35dd3cf55081b954dce212d56f00733?hp=238d782d824210e881b0639d33859c26a55511f7 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid --- diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c index 0fff09fabb..f7d686ec9a 100644 --- a/src/surf/surf_config.c +++ b/src/surf/surf_config.c @@ -460,14 +460,16 @@ void surf_config_models_setup(const char *platform_file) * we should switch to the "compound" workstation model to correctly dispatch stuff to * the right net/cpu models. */ - if ((strcmp(network_model_name, "LV08") - || strcmp(cpu_model_name, "Cas01")) - && !strcmp(workstation_model_name, "CLM03")) { - const char *val = "compound"; - XBT_INFO - ("Switching workstation model to compound since you changed the network and/or cpu model(s)"); - xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val); - workstation_model_name = (char *) "compound"; + + if((!xbt_cfg_is_default_value(_surf_cfg_set, "network/model") || + !xbt_cfg_is_default_value(_surf_cfg_set, "cpu/model")) && + xbt_cfg_is_default_value(_surf_cfg_set, "workstation/model")) + { + const char *val = "compound"; + XBT_INFO + ("Switching workstation model to compound since you changed the network and/or cpu model(s)"); + xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val); + workstation_model_name = (char *) "compound"; } XBT_DEBUG("Workstation model: %s", workstation_model_name); diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index e9fcb2048b..2bced98dd1 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -93,9 +93,10 @@ void free(void *p) /* Make sure it works with md==NULL */ -#define HEAP_OFFSET (128<<20) /* Safety gap from the heap's break address. - * Try to increase this first if you experience - * strange errors under valgrind. */ +/* Safety gap from the heap's break address. + * Try to increase this first if you experience strange errors under + * valgrind. */ +#define HEAP_OFFSET (128UL<<20) void *mmalloc_get_default_md(void) { @@ -145,8 +146,9 @@ void mmalloc_preinit(void) { int res; if (!__mmalloc_default_mdp) { - __mmalloc_default_mdp = - mmalloc_attach(-1, (char *) sbrk(0) + HEAP_OFFSET); + unsigned long mask = ~((unsigned long)getpagesize() - 1); + void *addr = (void*)(((unsigned long)sbrk(0) + HEAP_OFFSET) & mask); + __mmalloc_default_mdp = mmalloc_attach(-1, addr); /* Fixme? only the default mdp in protected against forks */ res = xbt_os_thread_atfork(mmalloc_fork_prepare, mmalloc_fork_parent, mmalloc_fork_child);