1
1

HAVE_MALLOPT is defined only when we have it. It's not a 1/0 ttype of define, it's a

defined/undefined one.

This commit was SVN r9221.
Этот коммит содержится в:
George Bosilca 2006-03-08 22:29:01 +00:00
родитель c604c5da2f
Коммит 4fb373c7e8

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

@ -27,10 +27,10 @@
#include "ompi/mca/mpool/base/base.h" #include "ompi/mca/mpool/base/base.h"
#include "mpool_base_mem_cb.h" #include "mpool_base_mem_cb.h"
#if HAVE_MALLOPT == 1 #if defined(HAVE_MALLOPT)
#include <malloc.h> #include <malloc.h>
extern int mca_mpool_base_disable_sbrk; extern int mca_mpool_base_disable_sbrk;
#endif #endif /* defined(HAVE_MALLOPT) */
extern int mca_mpool_base_use_mem_hooks; extern int mca_mpool_base_use_mem_hooks;
@ -90,18 +90,18 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
opal_list_append(&mca_mpool_base_modules, (opal_list_item_t*) sm); opal_list_append(&mca_mpool_base_modules, (opal_list_item_t*) sm);
/* on the very first creation of a module we init the memory callback*/ /* on the very first creation of a module we init the memory callback*/
if(opal_list_get_size(&mca_mpool_base_modules) == 1) { if(opal_list_get_size(&mca_mpool_base_modules) == 1) {
if(mca_mpool_base_use_mem_hooks && if(mca_mpool_base_use_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) { 0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_register_release(mca_mpool_base_mem_cb, NULL); opal_mem_hooks_register_release(mca_mpool_base_mem_cb, NULL);
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t); OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t);
} }
#if HAVE_MALLOPT == 1 #if defined(HAVE_MALLOPT)
else if(mca_mpool_base_disable_sbrk) { else if(mca_mpool_base_disable_sbrk) {
mallopt(M_TRIM_THRESHOLD, -1); mallopt(M_TRIM_THRESHOLD, -1);
mallopt(M_MMAP_MAX, 0); mallopt(M_MMAP_MAX, 0);
} }
#endif #endif /* defined(HAVE_MALLOPT) */
} }
return module; return module;
} }