diff --git a/components/heap/linker.lf b/components/heap/linker.lf index 55b6465205..be3f7796c9 100644 --- a/components/heap/linker.lf +++ b/components/heap/linker.lf @@ -2,7 +2,7 @@ archive: libheap.a entries: if HEAP_TLSF_USE_ROM_IMPL = n: - heap_tlsf (noflash) + tlsf (noflash) multi_heap (noflash) if HEAP_POISONING_DISABLED = n: multi_heap_poisoning (noflash) diff --git a/components/heap/multi_heap.c b/components/heap/multi_heap.c index b87e923a3d..1a0871f457 100644 --- a/components/heap/multi_heap.c +++ b/components/heap/multi_heap.c @@ -11,11 +11,14 @@ #include #include #include -#include "tlsf.h" -#include "tlsf_block_functions.h" #include "multi_heap.h" #include "multi_heap_internal.h" +#if !CONFIG_HEAP_TLSF_USE_ROM_IMPL +#include "tlsf.h" +#include "tlsf_block_functions.h" +#endif + /* Note: Keep platform-specific parts in this header, this source file should depend on libc only */ #include "multi_heap_platform.h" @@ -75,7 +78,7 @@ typedef struct multi_heap_info { size_t free_bytes; size_t minimum_free_bytes; size_t pool_size; - tlsf_t heap_data; + void* heap_data; } heap_t; #ifdef CONFIG_HEAP_TLSF_USE_ROM_IMPL diff --git a/components/heap/multi_heap_poisoning.c b/components/heap/multi_heap_poisoning.c index b13b4f4a5a..24739637a8 100644 --- a/components/heap/multi_heap_poisoning.c +++ b/components/heap/multi_heap_poisoning.c @@ -21,7 +21,15 @@ /* Defines compile-time configuration macros */ #include "multi_heap_config.h" +#if !CONFIG_HEAP_TLSF_USE_ROM_IMPL #include "tlsf.h" +#else +/* Declaration of the tlsf_poison_fill_pfunc_set defined in RAM + * used to call IDF function multi_heap_internal_poison_fill_region() + * in this source file + */ +extern void tlsf_poison_fill_pfunc_set(void *pfunc); +#endif #ifdef MULTI_HEAP_POISONING diff --git a/docs/en/COPYRIGHT.rst b/docs/en/COPYRIGHT.rst index 0238b4ea4d..1ce90ddd22 100644 --- a/docs/en/COPYRIGHT.rst +++ b/docs/en/COPYRIGHT.rst @@ -57,7 +57,7 @@ These third party libraries can be included into the application (firmware) prod * `cryptoauthlib`_ Microchip CryptoAuthentication Library - Copyright (c) 2015 - 2018 Microchip Technology Inc, is licensed under common Microchip software License as described in :example_file:`LICENSE file ` -* :component_file:`TLSF allocator ` Two Level Segregated Fit memory allocator, Copyright (c) 2006-2016, Matthew Conte, and licensed under the BSD license. +* `TLSF allocator ` Two Level Segregated Fit memory allocator, Copyright (c) 2006-2016, Matthew Conte, and licensed under the BSD 3-clause license. * `qrcode`_ QR Code generator library Copyright (c) Project Nayuki, is licensed under MIT license.