mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 07:16:15 +00:00
Fixed: Compilation under Mac OS X (malloc is already aligned on 16 bytes and memalign doesn't exist)
This commit is contained in:
parent
f601e916bf
commit
05be67e263
1 changed files with 5 additions and 0 deletions
|
@ -364,6 +364,11 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
|
|||
#include <malloc.h>
|
||||
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 <malloc/malloc.h>
|
||||
// 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 <malloc.h>
|
||||
inline void *aligned_malloc(size_t size, size_t alignment) { return memalign(alignment, size); }
|
||||
|
|
Loading…
Reference in a new issue