mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
feat(heap): Update get allocated size function to take any pointer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -38,6 +38,20 @@ typedef bool (*multi_heap_walker_cb_t)(void *block_ptr, size_t block_size, int b
|
||||
*/
|
||||
void multi_heap_walk(multi_heap_handle_t heap, multi_heap_walker_cb_t walker_func, void *user_data);
|
||||
|
||||
/**
|
||||
* @brief Function walking through a given heap and returning the pointer to the
|
||||
* allocated block containing the pointer passed as parameter.
|
||||
*
|
||||
* @note The heap parameter must be valid and the pointer parameter must
|
||||
* belong to a block of allocated memory. The app will crash with an
|
||||
* assertion failure if at least one of the parameter is invalid.
|
||||
*
|
||||
* @param heap The heap to walk through
|
||||
* @param ptr The pointer to find the allocated block of
|
||||
* @return Pointer to the allocated block containing the pointer ptr
|
||||
*/
|
||||
void *multi_heap_find_containing_block_impl(multi_heap_handle_t heap, void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user