From 7c82811e70ea2ffe639c91ea36f1b822d9336695 Mon Sep 17 00:00:00 2001 From: Guillaume Souchere Date: Wed, 31 Jan 2024 09:00:35 +0100 Subject: [PATCH] feat(newlib): Add definition of aligned_alloc to heap.c Add the definition of aligned_alloc to the list of definitions provided by heap.c. Note that memalign (strictly equivalent) to aligned_alloc is already defined in heap.c. --- components/newlib/heap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/newlib/heap.c b/components/newlib/heap.c index fca44906a2..fbcaf8c147 100644 --- a/components/newlib/heap.c +++ b/components/newlib/heap.c @@ -74,6 +74,11 @@ void* memalign(size_t alignment, size_t n) return heap_caps_aligned_alloc(alignment, n, MALLOC_CAP_DEFAULT); } +void* aligned_alloc(size_t alignment, size_t n) +{ + return heap_caps_aligned_alloc(alignment, n, MALLOC_CAP_DEFAULT); +} + int posix_memalign(void **out_ptr, size_t alignment, size_t size) { if (size == 0) {