From 80fa8eef6ebbc1dd1495bf35d6c075ecf780c1e0 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Sun, 27 May 2007 03:55:21 +0000 Subject: [PATCH] Don't include malloc.h in mpool/base/base.h because it causes all kinds of problems when the memory debugging stuff is enabled. Push it down into the two .c files that do use it. This commit was SVN r14779. --- ompi/mca/mpool/base/base.h | 8 -------- ompi/mca/mpool/base/mpool_base_lookup.c | 15 ++++++++++----- ompi/mca/mpool/base/mpool_base_open.c | 17 +++++++++++++---- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ompi/mca/mpool/base/base.h b/ompi/mca/mpool/base/base.h index 267c52f857..eaa879d596 100644 --- a/ompi/mca/mpool/base/base.h +++ b/ompi/mca/mpool/base/base.h @@ -28,14 +28,6 @@ #include "opal/mca/mca.h" #include "ompi/mca/mpool/mpool.h" #include "opal/threads/mutex.h" -#ifdef HAVE_MALLOC_H -#include -#endif -#if defined(HAVE_MALLOPT) && defined(M_TRIM_THRESHOLD) && defined(M_MMAP_MAX) -#define MPOOL_BASE_CAN_DISABLE_SBRK 1 -#else -#define MPOOL_BASE_CAN_DISABLE_SBRK 0 -#endif #if defined(c_plusplus) || defined(__cplusplus) extern "C" { diff --git a/ompi/mca/mpool/base/mpool_base_lookup.c b/ompi/mca/mpool/base/mpool_base_lookup.c index f5d593e4b5..80ae1ef0db 100644 --- a/ompi/mca/mpool/base/mpool_base_lookup.c +++ b/ompi/mca/mpool/base/mpool_base_lookup.c @@ -17,10 +17,20 @@ * $HEADER$ */ +#define OMPI_DISABLE_ENABLE_MEM_DEBUG 1 #include "ompi_config.h" #include #include +#ifdef HAVE_MALLOC_H +#include +extern int mca_mpool_base_disable_sbrk; +#endif +#if defined(HAVE_MALLOPT) && defined(M_TRIM_THRESHOLD) && defined(M_MMAP_MAX) +#define MPOOL_BASE_CAN_DISABLE_SBRK 1 +#else +#define MPOOL_BASE_CAN_DISABLE_SBRK 0 +#endif #include "opal/mca/mca.h" #include "opal/mca/base/base.h" @@ -28,11 +38,6 @@ #include "ompi/mca/mpool/base/base.h" #include "mpool_base_mem_cb.h" -#if MPOOL_BASE_CAN_DISABLE_SBRK -#include -extern int mca_mpool_base_disable_sbrk; -#endif /* MPOOL_BASE_CAN_DISABLE_SBRK */ - extern int mca_mpool_base_use_mem_hooks; extern ompi_pointer_array_t mca_mpool_base_mem_cb_array; diff --git a/ompi/mca/mpool/base/mpool_base_open.c b/ompi/mca/mpool/base/mpool_base_open.c index 6b8eca3257..f3a4ff928b 100644 --- a/ompi/mca/mpool/base/mpool_base_open.c +++ b/ompi/mca/mpool/base/mpool_base_open.c @@ -17,9 +17,21 @@ * $HEADER$ */ - +#define OMPI_DISABLE_ENABLE_MEM_DEBUG 1 #include "ompi_config.h" + #include +#ifdef HAVE_UNISTD_H +#include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_MALLOC_H +#include +#endif +#if defined(HAVE_MALLOPT) && defined(M_TRIM_THRESHOLD) && defined(M_MMAP_MAX) +#define MPOOL_BASE_CAN_DISABLE_SBRK 1 +#else +#define MPOOL_BASE_CAN_DISABLE_SBRK 0 +#endif #include "opal/mca/mca.h" #include "opal/mca/base/base.h" @@ -27,9 +39,6 @@ #include "ompi/mca/mpool/mpool.h" #include "ompi/mca/mpool/base/base.h" #include "ompi/constants.h" -#ifdef HAVE_UNISTD_H -#include -#endif /* HAVE_UNISTD_H */ /* * The following file was created by configure. It contains extern