Apple doesn't consider aligned_alloc() worth implementing, so fall back to posix_memalign() on macOS.
aligned_alloc()
posix_memalign()