From 0d8bf80364a23d9b90ab6c034625b60e4c566c61 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 19 Apr 2024 14:58:38 -0400 Subject: config: Check for aligned_alloc() --- src/alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index ec8608f..ebaff38 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -24,12 +24,12 @@ static void *xmemalign(size_t align, size_t size) { bfs_assert(align >= sizeof(void *)); bfs_assert(is_aligned(align, size)); -#if __APPLE__ +#if BFS_HAS_ALIGNED_ALLOC + return aligned_alloc(align, size); +#else void *ptr = NULL; errno = posix_memalign(&ptr, align, size); return ptr; -#else - return aligned_alloc(align, size); #endif } -- cgit v1.2.3