Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cmake: kill MMALLOC_WANT_OVERRIDE_LEGACY that dupplicated HAVE_MC
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Mar 2016 14:44:54 +0000 (15:44 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Mar 2016 15:07:12 +0000 (16:07 +0100)
CMakeLists.txt
src/xbt/mmalloc/mm_legacy.c
src/xbt/xbt_main.c
tools/cmake/MakeLib.cmake
tools/cmake/src/internal_config.h.in

index 48070fd..4459d8d 100644 (file)
@@ -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)
index e9e250f..c9644fc 100644 (file)
@@ -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 */
index ff685cd..319a422 100644 (file)
@@ -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
 }
index 188a2ec..4115a97 100644 (file)
@@ -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()
 
index fce226e..590c80f 100644 (file)
@@ -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@