diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | 004b98220a30de0d1956a8149d8bc6ec356667da (patch) | |
tree | 1eaee2603984d7ab4524be68b57ce0a2b2b72118 /zutil_p.h | |
parent | 2ca0d0b38b60e8d6d49a8959bf674a79e7d16f41 (diff) | |
parent | a583e215afa2356e23b418efa871a1cc4348702a (diff) |
Merge tag '2.0.7' into tachibanatachibana-mr1tachibana
Change-Id: I7b03d60d67d184c21ff7437a35062077666951e9
Diffstat (limited to 'zutil_p.h')
-rw-r--r-- | zutil_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -9,7 +9,7 @@ # define _POSIX_C_SOURCE 200112L /* For posix_memalign(). */ #endif -#if defined(__APPLE__) || defined(HAVE_POSIX_MEMALIGN) +#if defined(__APPLE__) || defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_ALIGNED_ALLOC) # include <stdlib.h> #elif defined(__FreeBSD__) # include <stdlib.h> @@ -27,6 +27,8 @@ static inline void *zng_alloc(size_t size) { return (void *)_aligned_malloc(size, 64); #elif defined(__APPLE__) return (void *)malloc(size); /* MacOS always aligns to 16 bytes */ +#elif defined(HAVE_ALIGNED_ALLOC) + return (void *)aligned_alloc(64, size); #else return (void *)memalign(64, size); #endif |