MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / cmd_free

Function cmd_free

components/finsh/msh.c:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75#ifdef RT_USING_HEAP
76static int cmd_free(int argc, char **argv)
77{
78#ifdef RT_USING_MEMHEAP_AS_HEAP
79 extern void list_memheap(void);
80 list_memheap();
81#else
82 rt_size_t total = 0, used = 0, max_used = 0;
83
84 rt_memory_info(&total, &used, &max_used);
85 rt_kprintf("total : %d\n", total);
86 rt_kprintf("used : %d\n", used);
87 rt_kprintf("maximum : %d\n", max_used);
88 rt_kprintf("available: %d\n", total - used);
89#endif
90 return 0;
91}
92MSH_CMD_EXPORT_ALIAS(cmd_free, free, Show the memory usage in the system);
93#endif /* RT_USING_HEAP */
94

Callers 4

cmd_sd_bench_taskFunction · 0.85
cmd_sd_press_read_taskFunction · 0.85
cmd_sd_press_write_taskFunction · 0.85
cmd_sd_press_execFunction · 0.85

Calls 3

list_memheapFunction · 0.85
rt_memory_infoFunction · 0.85
rt_kprintfFunction · 0.85

Tested by

no test coverage detected