summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorguo <[email protected]>2022-06-16 14:19:24 +0800
committerGitHub <[email protected]>2022-06-16 14:19:24 +0800
commitb1fab8942a2c6e73abca4809ace8050a6ba20fd7 (patch)
tree7ebb303eea8f6f8500bbcd9d83ca3c2962da1cf1 /components
parent3323366694f9af8fb384396a1811e0112b3248ff (diff)
[msh]Restore the free command.|还原 free命令。 (#6084)
Diffstat (limited to 'components')
-rw-r--r--components/finsh/msh.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/finsh/msh.c b/components/finsh/msh.c
index 5272f0728a..7bf0a90f53 100644
--- a/components/finsh/msh.c
+++ b/components/finsh/msh.c
@@ -73,12 +73,17 @@ MSH_CMD_EXPORT_ALIAS(cmd_ps, ps, List threads in the system.);
#ifdef RT_USING_HEAP
int cmd_free(int argc, char **argv)
{
+#ifdef RT_USING_MEMHEAP_AS_HEAP
+ extern void list_memheap(void);
+ list_memheap();
+#else
rt_size_t total = 0, used = 0, max_used = 0;
rt_memory_info(&total, &used, &max_used);
rt_kprintf("total : %d\n", total);
rt_kprintf("used : %d\n", used);
rt_kprintf("maximum : %d\n", max_used);
+#endif
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_free, free, Show the memory usage in the system.);