From bd09ed439ea2ce380f58a1154632416393bff939 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 7 Mar 2016 15:44:54 +0100 Subject: [PATCH] cmake: kill MMALLOC_WANT_OVERRIDE_LEGACY that dupplicated HAVE_MC --- CMakeLists.txt | 2 -- src/xbt/mmalloc/mm_legacy.c | 5 +++-- src/xbt/xbt_main.c | 4 ++-- tools/cmake/MakeLib.cmake | 2 +- tools/cmake/src/internal_config.h.in | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48070fd9d8..4459d8d4bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,7 +348,6 @@ endif() if(enable_model-checking AND HAVE_MMALLOC) SET(HAVE_MC 1) - SET(MMALLOC_WANT_OVERRIDE_LEGACY 1) include(FindLibunwind) include(FindLibdw) else() @@ -357,7 +356,6 @@ else() endif() SET(HAVE_MC 0) SET(HAVE_MMALLOC 0) - SET(MMALLOC_WANT_OVERRIDE_LEGACY 0) endif() if(enable_smpi) diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index e9e250fa23..c9644fc3dc 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -50,7 +50,8 @@ xbt_mheap_t mmalloc_set_current_heap(xbt_mheap_t new_heap) return heap; } -#ifdef MMALLOC_WANT_OVERRIDE_LEGACY +/* Override the malloc-like functions if MC is activated at compile time */ +#ifdef HAVE_MC /* ***** Temporary allocator * @@ -255,4 +256,4 @@ void free(void *p) mfree(mdp, p); UNLOCK(mdp); } -#endif /* WANT_MALLOC_OVERRIDE */ +#endif /* HAVE_MC */ diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index ff685cd3ad..319a42296c 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -10,7 +10,7 @@ #include "xbt/misc.h" #include "simgrid_config.h" -#include "src/internal_config.h" /* MMALLOC_WANT_OVERRIDE_LEGACY */ +#include "src/internal_config.h" /* HAVE_MC */ #include "src/portable.h" #include "xbt/sysdep.h" #include "xbt/log.h" @@ -127,7 +127,7 @@ static void xbt_postexit(void) xbt_dynar_free(&xbt_cmdline); xbt_log_postexit(); free(xbt_binary_name); -#ifdef MMALLOC_WANT_OVERRIDE_LEGACY +#ifdef HAVE_MC mmalloc_postexit(); #endif } diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 188a2ec348..4115a97a2d 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -88,7 +88,7 @@ if(HAVE_MC) endif() endif() -if(MMALLOC_WANT_OVERRIDE_LEGACY AND HAVE_GNU_LD) +if(HAVE_MC AND HAVE_GNU_LD) SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl") endif() diff --git a/tools/cmake/src/internal_config.h.in b/tools/cmake/src/internal_config.h.in index fce226e016..590c80fe2e 100644 --- a/tools/cmake/src/internal_config.h.in +++ b/tools/cmake/src/internal_config.h.in @@ -48,8 +48,7 @@ #cmakedefine HAVE_GETDTABLESIZE @HAVE_GETDTABLESIZE@ /* getdtablesize: get descriptor table size */ #cmakedefine HAVE_MMALLOC @HAVE_MMALLOC@ /* Did we compile mmalloc in? */ #cmakedefine HAVE_PROCESS_VM_READV @HAVE_PROCESS_VM_READV@ /* process_vm_readv: transfer data between process address spaces */ -#cmakedefine MMALLOC_WANT_OVERRIDE_LEGACY @MMALLOC_WANT_OVERRIDE_LEGACY@ /* Set to true if enable_model-checking is true */ -#cmakedefine HAVE_MC @HAVE_MC@ +#cmakedefine HAVE_MC @HAVE_MC@ /* Set to true if enable_model-checking is true and the dependencies available */ /* SMPI variables */ #cmakedefine HAVE_SMPI @HAVE_SMPI@ -- 2.20.1