From 8d3ea38ffcbc4139c3e85f6d1ac2740da31c0bdc Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 27 Aug 2014 11:16:30 +0200 Subject: [PATCH] Fixed: Compilation under Mac OS X (malloc is already aligned on 16 bytes and memalign doesn't exist) --- code/nel/include/nel/misc/types_nl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index d27fc4b48..d7068a833 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -364,6 +364,11 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #include inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); } inline void aligned_free(void *ptr) { _aligned_free(ptr); } +#elif defined(NL_OS_MAC) +#include +// under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment) +inline void *aligned_malloc(size_t size, size_t alignment) { return malloc(size); } +inline void aligned_free(void *ptr) { free(ptr); } #else #include inline void *aligned_malloc(size_t size, size_t alignment) { return memalign(alignment, size); }