feat(heap): Add return value to walker callback

This return value is used by the tlsf_walk_pool
function to be notified of the need to interrupt
the ongoing traversal of the currently traversed
heap.
This commit is contained in:
Guillaume Souchere
2024-02-27 12:32:15 +01:00
parent 5cc69ce12b
commit 34fb83ffbc
6 changed files with 77 additions and 21 deletions

View File

@@ -214,8 +214,11 @@ void multi_heap_restore_minimum_free_bytes(multi_heap_handle_t heap, const size_
* @param block_size The size of the block
* @param block_used Block status. 0 if free, else, false
* @param user_data Opaque pointer to user defined data
*
* @return True if the walker is expected to continue the heap traversal
* False if the walker is expected to stop the traversal of the heap
*/
typedef void (*multi_heap_walker_cb_t)(void *block_ptr, size_t block_size, int block_used, void *user_data);
typedef bool (*multi_heap_walker_cb_t)(void *block_ptr, size_t block_size, int block_used, void *user_data);
/**
* @brief Call the tlsf_walk_pool function of the heap given as parameter with