summaryrefslogtreecommitdiff
path: root/zutil_p.h
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
committeralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
commit004b98220a30de0d1956a8149d8bc6ec356667da (patch)
tree1eaee2603984d7ab4524be68b57ce0a2b2b72118 /zutil_p.h
parent2ca0d0b38b60e8d6d49a8959bf674a79e7d16f41 (diff)
parenta583e215afa2356e23b418efa871a1cc4348702a (diff)
Merge tag '2.0.7' into tachibanatachibana-mr1tachibana
Change-Id: I7b03d60d67d184c21ff7437a35062077666951e9
Diffstat (limited to 'zutil_p.h')
-rw-r--r--zutil_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/zutil_p.h b/zutil_p.h
index 55f0061..856b44f 100644
--- a/zutil_p.h
+++ b/zutil_p.h
@@ -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