From c8c31326050a546c230b65144a79e1d98be8ec99 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 1 Oct 2009 23:51:48 +0000 Subject: [PATCH] Also check for posix_memalign. This commit was SVN r22045. --- opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c index c5f251281f..35ec8525d0 100644 --- a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c @@ -114,6 +114,17 @@ static int ptmalloc2_open(void) } free(p); +#if HAVE_POSIX_MEMALIGN + /* Double check for posix_memalign, too */ + if (opal_memory_ptmalloc2_memalign_invoked) { + opal_memory_ptmalloc2_memalign_invoked = false; + if (0 != posix_memalign(&p, sizeof(void*), 1024 * 1024) || NULL == p) { + return OPAL_ERR_OUT_OF_RESOURCE; + } + free(p); + } +#endif + if (opal_memory_ptmalloc2_malloc_invoked && opal_memory_ptmalloc2_realloc_invoked && opal_memory_ptmalloc2_memalign_invoked &&