From d1e6fdd3674eff0e09554c7ddc431acb8925232f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 3 Jun 2020 19:11:23 -0400 Subject: reverse dependency order of memalign and aligned_alloc this change eliminates the internal __memalign function and makes the memalign and posix_memalign functions completely independent of the malloc implementation, written portably in terms of aligned_alloc. --- src/malloc/posix_memalign.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/malloc/posix_memalign.c') diff --git a/src/malloc/posix_memalign.c b/src/malloc/posix_memalign.c index 2ea8bd8a..ad4d8f47 100644 --- a/src/malloc/posix_memalign.c +++ b/src/malloc/posix_memalign.c @@ -1,11 +1,10 @@ #include #include -#include "malloc_impl.h" int posix_memalign(void **res, size_t align, size_t len) { if (align < sizeof(void *)) return EINVAL; - void *mem = __memalign(align, len); + void *mem = aligned_alloc(align, len); if (!mem) return errno; *res = mem; return 0; -- cgit v1.2.1