Created
February 26, 2025 11:57
-
-
Save arifbalik/232ee46b6fa3b1ab3ddcbf1b5864b154 to your computer and use it in GitHub Desktop.
Zephyr Heap Info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern struct k_heap _system_heap; | |
struct sys_memory_stats stats; | |
void rtos_hal_print_heap_info(void) | |
{ | |
sys_heap_runtime_stats_get(&_system_heap.heap, &stats); | |
printk("\n"); | |
printk("INFO: Allocated Heap = %zu\n", stats.allocated_bytes); | |
printk("INFO: Free Heap = %zu\n", stats.free_bytes); | |
printk("INFO: Max Allocated Heap = %zu\n", stats.max_allocated_bytes); | |
printk("\n"); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment