heap: Provide definition of the tlsf_check_hook() declared in the tlsf submodule

Add the definition of tlsf_check_hook() in multi_heap if MULTI_HEAP_POISONING
is set. This definition calls the multi_heap_internal_check_block_poisoning()
to check the memory of a free block for corruption. If the light poisoinng is
set this function returns true. If the comprehensive poisoning is set, this
function will check that all byte of memory in the memory chunk passed as parameter
are set to the right FILL pattern.
This commit is contained in:
Guillaume Souchere
2022-08-09 13:53:10 +02:00
parent c5b094a96f
commit f051da86e2
3 changed files with 37 additions and 2 deletions

View File

@@ -125,6 +125,8 @@ void multi_heap_dump(multi_heap_handle_t heap);
* can be optionally printed to stderr. Print behaviour can be overridden at compile time by defining
* MULTI_CHECK_FAIL_PRINTF in multi_heap_platform.h.
*
* @note This function is not thread-safe as it sets a global variable with the value of print_errors.
*
* @param heap Handle to a registered heap.
* @param print_errors If true, errors will be printed to stderr.
* @return true if heap is valid, false otherwise.