flipperzero-firmware/core/furi/memmgr_heap.h
あく 839e52ac32
[FL-2591] Furi: remove CMSIS thread api, migrate to FuriThread, remove unused CMSIS APIs (#1333)
* Furi: remove CMSIS thread api, migrate to FuriThread, remove unused CMSIS APIs
* Furi: magic thread catcher validating thread completion; backtrace improver
* Furi: allow furi_thread_get_current_id outside of thread context
* Furi: use IRQ instead of ISR for core primitives
2022-06-20 18:54:48 +04:00

50 lines
1.0 KiB
C

/**
* @file memmgr_heap.h
* Furi: heap memory managment API and allocator
*/
#pragma once
#include <stdint.h>
#include "furi/thread.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(FuriThreadId taks_handle);
/** Memmgr heap disable thread allocation tracking
*
* @param thread_id - thread id to track
*/
void memmgr_heap_disable_thread_trace(FuriThreadId taks_handle);
/** 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(FuriThreadId taks_handle);
/** 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