memmgr_heap.h 893 B

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