1
1

* It appears that AIX provides a mallopt, but not the options to disable

sbrk and the use of mmap().  So rather than checking just for mallopt(),
  we should also be checking for those defines when determining if we can
  disable giving memory back to the OS or not.

This commit was SVN r11279.
Этот коммит содержится в:
Brian Barrett 2006-08-21 14:00:30 +00:00
родитель 2922837fb4
Коммит 75d32b4013
3 изменённых файлов: 15 добавлений и 9 удалений

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

@ -29,6 +29,12 @@
#include "ompi/mca/mpool/mpool.h"
#include "opal/threads/mutex.h"
#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" {
#endif

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

@ -27,10 +27,10 @@
#include "ompi/mca/mpool/base/base.h"
#include "mpool_base_mem_cb.h"
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
#include <malloc.h>
extern int mca_mpool_base_disable_sbrk;
#endif /* defined(HAVE_MALLOPT) */
#endif /* MPOOL_BASE_CAN_DISABLE_SBRK */
extern int mca_mpool_base_use_mem_hooks;
@ -99,12 +99,12 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t);
}
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
else if(mca_mpool_base_disable_sbrk) {
mallopt(M_TRIM_THRESHOLD, -1);
mallopt(M_MMAP_MAX, 0);
}
#endif /* defined(HAVE_MALLOPT) */
#endif /* MPOOL_BASE_CAN_DISABLE_SBRK */
}
return module;
}

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

@ -43,7 +43,7 @@
int mca_mpool_base_output = -1;
int mca_mpool_base_use_mem_hooks = 0;
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
int mca_mpool_base_disable_sbrk = 0;
#endif
@ -63,9 +63,9 @@ int mca_mpool_base_open(void)
mca_mpool_base_components list */
int use_mem_hooks;
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
int disable_sbrk;
#endif /* defined(HAVE_MALLOPT) */
#endif /* MPOOL_BASE_CAN_DISABLE_SBRK */
if (OMPI_SUCCESS !=
mca_base_components_open("mpool", 0, mca_mpool_base_static_components,
@ -101,7 +101,7 @@ int mca_mpool_base_open(void)
mca_mpool_base_use_mem_hooks = use_mem_hooks || mca_mpool_base_use_mem_hooks;
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
mca_base_param_reg_int_name("mpool",
"base_disable_sbrk",
"use mallopt to override calling sbrk (doesn't return memory to OS!)",
@ -123,7 +123,7 @@ int mca_mpool_base_open(void)
#endif
/* force mem hooks if leave_pinned or leave_pinned_pipeline is enabled */
#if defined(HAVE_MALLOPT)
#if MPOOL_BASE_CAN_DISABLE_SBRK
if(0 == mca_mpool_base_use_mem_hooks && 0 == mca_mpool_base_disable_sbrk) {
#else
if(0 == mca_mpool_base_use_mem_hooks ) {