Skip to content

Commit

Permalink
Fix linking.
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Dec 3, 2024
1 parent f91dcc2 commit 7799bbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions components/heap/heap_caps_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ HEAP_IRAM_ATTR void heap_caps_free( void *ptr)
}

HEAP_IRAM_ATTR static inline void *aligned_or_unaligned_alloc(multi_heap_handle_t heap, size_t size, size_t alignment, size_t offset) {
#ifdef CONFIG_CMPCT_MALLOC_HEAP
return multi_heap_malloc(heap, size);
#else
if (alignment<=UNALIGNED_MEM_ALIGNMENT_BYTES) { //alloc and friends align to 32-bit by default
return multi_heap_malloc(heap, size);
} else {
return multi_heap_aligned_alloc_offs(heap, size, alignment, offset);
}
#endif
}

/*
Expand Down
8 changes: 4 additions & 4 deletions components/heap/multi_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
/* Defines compile-time configuration macros */
#include "multi_heap_config.h"

#if (!defined MULTI_HEAP_POISONING)
#if (!defined MULTI_HEAP_POISONING) && (!defined CONFIG_CMPCT_MALLOC_HEAP)

void *multi_heap_aligned_alloc_offs(multi_heap_handle_t heap, size_t size, size_t alignment, size_t offset)
{
return multi_heap_aligned_alloc_impl_offs(heap, size, alignment, offset);
}

#if (!defined CONFIG_HEAP_TLSF_USE_ROM_IMPL) && (!defined CONFIG_CMPCT_MALLOC_HEAP)
#if (!defined CONFIG_HEAP_TLSF_USE_ROM_IMPL)
/* if no heap poisoning, public API aliases directly to these implementations */
void *multi_heap_malloc(multi_heap_handle_t heap, size_t size)
__attribute__((alias("multi_heap_malloc_impl")));
Expand Down Expand Up @@ -82,8 +82,8 @@ void multi_heap_iterate_tagged_memory_areas(multi_heap_handle_t heap, void *user
{
}

#endif // !CONFIG_HEAP_TLSF_USE_ROM_IMPL && !CONFIG_CMPCT_MALLOC_HEAP
#endif // !MULTI_HEAP_POISONING
#endif // !CONFIG_HEAP_TLSF_USE_ROM_IMPL
#endif // !MULTI_HEAP_POISONING && !CONFIG_CMPCT_MALLOC_HEAP


#define ALIGN(X) ((X) & ~(sizeof(void *)-1))
Expand Down

0 comments on commit 7799bbb

Please sign in to comment.