[FL-1326] Move heap4 allocator to furi core and add allocation tracing capability (#529)
* Move heap memory allocator to furi core * Newlibc: add malloc guards * Furi: add cmsis thread id getter * Core: add tracing capability to heap allocator. Add heap tracing support to furi thread. Add heap trace support to app-loader.
This commit is contained in:
28
core/furi/memmgr_heap.h
Normal file
28
core/furi/memmgr_heap.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cmsis_os2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** 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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user