Support systems without malloc.h or posix_memalign (ie, pretty much every
one we support that isn't Linux) This commit was SVN r12880.
Этот коммит содержится в:
родитель
b448b4e47e
Коммит
c554638446
@ -713,7 +713,7 @@ OMPI_CHECK_FUNC_LIB([dirname], [gen])
|
|||||||
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
|
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
|
||||||
OMPI_CHECK_FUNC_LIB([ceil], [m])
|
OMPI_CHECK_FUNC_LIB([ceil], [m])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty htonl ntohl htons ntohs getpwuid fork waitpid execve pipe ptsname setsid mmap mallopt tcgetpgrp])
|
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty htonl ntohl htons ntohs getpwuid fork waitpid execve pipe ptsname setsid mmap mallopt tcgetpgrp posix_memalign])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Make sure we can copy va_lists (need check declared, not linkable)
|
# Make sure we can copy va_lists (need check declared, not linkable)
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
#include "orte/util/proc_info.h"
|
#include "orte/util/proc_info.h"
|
||||||
#include "orte/util/sys_info.h"
|
#include "orte/util/sys_info.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local functions
|
* Local functions
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
|
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#include "ompi/mca/rcache/rcache.h"
|
#include "ompi/mca/rcache/rcache.h"
|
||||||
#include "ompi/mca/rcache/base/base.h"
|
#include "ompi/mca/rcache/base/base.h"
|
||||||
#include "ompi/mca/mpool/base/base.h"
|
#include "ompi/mca/mpool/base/base.h"
|
||||||
@ -82,8 +84,14 @@ void* mca_mpool_rdma_alloc(mca_mpool_base_module_t *mpool, size_t size,
|
|||||||
{
|
{
|
||||||
void *addr;
|
void *addr;
|
||||||
|
|
||||||
|
#ifdef HAVE_POSIX_MEMALIGN
|
||||||
if(posix_memalign(&addr, mca_mpool_base_page_size, size) != 0)
|
if(posix_memalign(&addr, mca_mpool_base_page_size, size) != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#else
|
||||||
|
if (NULL == (addr = malloc(size))) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(OMPI_SUCCESS != mca_mpool_rdma_register(mpool, addr, size, flags, reg)) {
|
if(OMPI_SUCCESS != mca_mpool_rdma_register(mpool, addr, size, flags, reg)) {
|
||||||
free(addr);
|
free(addr);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user