feat(tlsf): Add function to find a block from a pointer

This commit is contained in:
Guillaume Souchere
2024-11-04 10:02:51 +01:00
parent ba64d198a8
commit 791878ead2
2 changed files with 29 additions and 0 deletions

View File

@@ -63,6 +63,15 @@ void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user);
int tlsf_check(tlsf_t tlsf);
int tlsf_check_pool(pool_t pool);
/**
* @brief Find the block containing the pointer passed as parameter
*
* @param pool The pool into which to look for the block
* @param ptr The pointer we want to find the containing block of
* @return void* The pointer to the containing block if found, NULL if not.
*/
void* tlsf_find_containing_block(pool_t pool, void *ptr);
/**
* @brief Weak function called on every free block of memory allowing the user to implement
* application specific checks on the memory.