1
1

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.
Этот коммит содержится в:
Brian Barrett 2007-05-27 03:55:21 +00:00
родитель eff77f7cbb
Коммит 80fa8eef6e
3 изменённых файлов: 23 добавлений и 17 удалений

Просмотреть файл

@ -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 <malloc.h>
#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" {

Просмотреть файл

@ -17,10 +17,20 @@
* $HEADER$
*/
#define OMPI_DISABLE_ENABLE_MEM_DEBUG 1
#include "ompi_config.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
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 <malloc.h>
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;

Просмотреть файл

@ -17,9 +17,21 @@
* $HEADER$
*/
#define OMPI_DISABLE_ENABLE_MEM_DEBUG 1
#include "ompi_config.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#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 <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
* The following file was created by configure. It contains extern