Skip to content

Commit db3e25e

Browse files
committed
Update mca_mpool_base_alloc to use malloc instead of posix_memalign for alignment requests of <= sizeof(void *). This works around issue #4564.
Signed-off-by: Ben Menadue <[email protected]>
1 parent 2c86b87 commit db3e25e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

opal/mca/mpool/base/mpool_base_default.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ static void *mca_mpool_default_alloc (mca_mpool_base_module_t *mpool, size_t siz
3131
#if HAVE_POSIX_MEMALIGN
3232
void *addr = NULL;
3333

34-
(void) posix_memalign (&addr, align, size);
34+
if (align <= sizeof(void *)) {
35+
addr = malloc (size);
36+
} else {
37+
(void) posix_memalign (&addr, align, size);
38+
}
3539
return addr;
3640
#else
3741
void *addr, *ret;

0 commit comments

Comments
 (0)