1
1

Support systems without malloc.h or posix_memalign (ie, pretty much every

one we support that isn't Linux)

This commit was SVN r12880.
Этот коммит содержится в:
Brian Barrett 2006-12-17 17:28:59 +00:00
родитель b448b4e47e
Коммит c554638446
3 изменённых файлов: 11 добавлений и 1 удалений

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

@ -713,7 +713,7 @@ OMPI_CHECK_FUNC_LIB([dirname], [gen])
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
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)

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

@ -26,7 +26,9 @@
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include <unistd.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
/*
* Local functions

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

@ -25,7 +25,9 @@
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
#include <errno.h>
#include <string.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "ompi/mca/rcache/rcache.h"
#include "ompi/mca/rcache/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;
#ifdef HAVE_POSIX_MEMALIGN
if(posix_memalign(&addr, mca_mpool_base_page_size, size) != 0)
return NULL;
#else
if (NULL == (addr = malloc(size))) {
return NULL;
}
#endif
if(OMPI_SUCCESS != mca_mpool_rdma_register(mpool, addr, size, flags, reg)) {
free(addr);