memmgr_heap.h 933 B

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