From b77bad442d21d407fd9efdcab64837543f33ee13 Mon Sep 17 00:00:00 2001 From: Naoaki Okazaki Date: Thu, 16 Dec 2010 19:02:14 +0900 Subject: [PATCH] Replaced memalign() with posix_memalign(). --- lib/arithmetic_sse_double.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/arithmetic_sse_double.h b/lib/arithmetic_sse_double.h index 7c25660..83405ee 100644 --- a/lib/arithmetic_sse_double.h +++ b/lib/arithmetic_sse_double.h @@ -46,7 +46,10 @@ inline static void* vecalloc(size_t size) #elif defined(__APPLE__) /* OS X always aligns on 16-byte boundaries */ void *memblock = malloc(size); #else - void *memblock = memalign(16, size); + void *memblock = NULL, *p = NULL; + if (posix_memalign(&p, 16, size) == 0) { + memblock = p; + } #endif if (memblock != NULL) { memset(memblock, 0, size);