瀏覽代碼

[msh]Restore the free command.|还原 free命令。 (#6084)

guo 2 年之前
父節點
當前提交
b1fab8942a
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      components/finsh/msh.c

+ 5 - 0
components/finsh/msh.c

@@ -73,12 +73,17 @@ MSH_CMD_EXPORT_ALIAS(cmd_ps, ps, List threads in the system.);
 #ifdef RT_USING_HEAP
 #ifdef RT_USING_HEAP
 int cmd_free(int argc, char **argv)
 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_size_t total = 0, used = 0, max_used = 0;
 
 
     rt_memory_info(&total, &used, &max_used);
     rt_memory_info(&total, &used, &max_used);
     rt_kprintf("total   : %d\n", total);
     rt_kprintf("total   : %d\n", total);
     rt_kprintf("used    : %d\n", used);
     rt_kprintf("used    : %d\n", used);
     rt_kprintf("maximum : %d\n", max_used);
     rt_kprintf("maximum : %d\n", max_used);
+#endif
     return 0;
     return 0;
 }
 }
 MSH_CMD_EXPORT_ALIAS(cmd_free, free, Show the memory usage in the system.);
 MSH_CMD_EXPORT_ALIAS(cmd_free, free, Show the memory usage in the system.);