heap: Remove TLSF related files and replace them with the tlsf submodule

As the tlsf implementation is a fork from https://github.com/mattconte/tlsf,
the sources are moved to a separate repository and used as a submodule in the esp-idf instead.

In this commit:
- Removing TLSF related files and using tlsf submodule instead.

- Adding components/heap/tlsf_platform.h header gathering all IDF specifics.

- The multi_heap_poisoning.c provides the declaration of the
function block_absorb_post_hook() definied weak in the TLSF repository.

- The tlsf_platform.h includes the tlsf_common.h file after the definition
of FL_INDEX_MAX_PLATFORM macro to make sure that this macro will be available
in tlsf_common.h without having to include tlaf_platform.h from IDF in the
tlsf_common.h header from the TLSF repository.

- Add missing include from tlsf_block_functions.h in the multi_heap.c file.
Change related to the changes made in TLSF repository (tlsf_block_functions.h
no longer included in tlsf.h)
This commit is contained in:
Guillaume Souchere
2022-07-20 13:59:14 +02:00
parent 6cc5e4aa3a
commit a2b60946ac
18 changed files with 111 additions and 1453 deletions

View File

@@ -21,7 +21,7 @@
/* Defines compile-time configuration macros */
#include "multi_heap_config.h"
#include "heap_tlsf.h"
#include "tlsf.h"
#ifdef MULTI_HEAP_POISONING
@@ -177,6 +177,22 @@ static bool verify_fill_pattern(void *data, size_t size, bool print_errors, bool
}
return valid;
}
/*!
* @brief Definition of the weak function declared in TLSF repository.
* The call of this function assures that the header of an absorbed
* block is filled with the correct pattern in case of comprehensive
* heap poisoning.
*
* @param start: pointer to the start of the memory region to fill
* @param size: size of the memory region to fill
* @param is_free: Indicate if the pattern to use the fill the region should be
* an after free or after allocation pattern.
*/
void block_absorb_post_hook(void *start, size_t size, bool is_free)
{
multi_heap_internal_poison_fill_region(start, size, is_free);
}
#endif
void *multi_heap_aligned_alloc(multi_heap_handle_t heap, size_t size, size_t alignment)