unleashed-firmware/core/furi/memmgr_heap.h
gornekich f05153ed5c
[FL-1816] Fix ble radio stack is alive check (#707)
* bt: fix bt_is_alive return, add bt_is_active
* bt: fix bt_is_alive return
* Cli: show heap usage in ps.
* FuriHal: strict sequence for flash operations
* Scripts: add stress test
* Core: proper heap calculation.

Co-authored-by: あく <alleteam@gmail.com>
2021-09-16 19:12:07 +03:00

41 lines
933 B
C

#pragma once
#include <stdint.h>
#include <cmsis_os2.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MEMMGR_HEAP_UNKNOWN 0xFFFFFFFF
/** Memmgr heap enable thread allocation tracking
* @param thread_id - thread id to track
*/
void memmgr_heap_enable_thread_trace(osThreadId_t thread_id);
/** Memmgr heap disable thread allocation tracking
* @param thread_id - thread id to track
*/
void memmgr_heap_disable_thread_trace(osThreadId_t thread_id);
/** Memmgr heap get allocatred thread memory
* @param thread_id - thread id to track
* @return bytes allocated right now
*/
size_t memmgr_heap_get_thread_memory(osThreadId_t thread_id);
/** Memmgr heap get the max contiguous block size on the heap
* @return size_t max contiguous block size
*/
size_t memmgr_heap_get_max_free_block();
/**
* Print the address and size of all free blocks to stdout
*/
void memmgr_heap_printf_free_blocks();
#ifdef __cplusplus
}
#endif