diff options
author | Rich Felker <dalias@aerifal.cx> | 2020-06-03 19:11:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2020-06-03 19:11:23 -0400 |
commit | d1e6fdd3674eff0e09554c7ddc431acb8925232f (patch) | |
tree | 0181f78dc2700d2028eb2e354030c648326506a6 /src/malloc/posix_memalign.c | |
parent | rename aligned_alloc source file (diff) | |
download | grovel-d1e6fdd3674eff0e09554c7ddc431acb8925232f.tar.gz grovel-d1e6fdd3674eff0e09554c7ddc431acb8925232f.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | src/malloc/posix_memalign.c | 3 |
1 files changed, 1 insertions, 2 deletions
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 <stdlib.h> #include <errno.h> -#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; |