diff --git a/lib/arithmetic_sse_float.h b/lib/arithmetic_sse_float.h index c5042bd..835b8aa 100644 --- a/lib/arithmetic_sse_float.h +++ b/lib/arithmetic_sse_float.h @@ -52,7 +52,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);