unleashed-firmware/furi/core/memmgr_heap.h
あく acc39a4bc0
Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-03-19 23:43:52 +09:00

50 lines
1.0 KiB
C

/**
* @file memmgr_heap.h
* Furi: heap memory management API and allocator
*/
#pragma once
#include <stdint.h>
#include <core/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 thread_id);
/** Memmgr heap disable thread allocation tracking
*
* @param thread_id - thread id to track
*/
void memmgr_heap_disable_thread_trace(FuriThreadId 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(FuriThreadId 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(void);
/** Print the address and size of all free blocks to stdout
*/
void memmgr_heap_printf_free_blocks(void);
#ifdef __cplusplus
}
#endif