memmgr_heap.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @file memmgr_heap.h
  3. * Furi: heap memory managment API and allocator
  4. */
  5. #pragma once
  6. #include <stdint.h>
  7. #include <core/thread.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define MEMMGR_HEAP_UNKNOWN 0xFFFFFFFF
  12. /** Memmgr heap enable thread allocation tracking
  13. *
  14. * @param thread_id - thread id to track
  15. */
  16. void memmgr_heap_enable_thread_trace(FuriThreadId taks_handle);
  17. /** Memmgr heap disable thread allocation tracking
  18. *
  19. * @param thread_id - thread id to track
  20. */
  21. void memmgr_heap_disable_thread_trace(FuriThreadId taks_handle);
  22. /** Memmgr heap get allocatred thread memory
  23. *
  24. * @param thread_id - thread id to track
  25. *
  26. * @return bytes allocated right now
  27. */
  28. size_t memmgr_heap_get_thread_memory(FuriThreadId taks_handle);
  29. /** Memmgr heap get the max contiguous block size on the heap
  30. *
  31. * @return size_t max contiguous block size
  32. */
  33. size_t memmgr_heap_get_max_free_block();
  34. /** Print the address and size of all free blocks to stdout
  35. */
  36. void memmgr_heap_printf_free_blocks();
  37. #ifdef __cplusplus
  38. }
  39. #endif