From f300ca1c9507f007ab300e8d7eef2b8b5368dc33 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Wed, 15 Jun 2022 18:32:21 +0800 Subject: [PATCH] =?UTF-8?q?[msh]Restore=20the=20free=20command.|=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=20free=E5=91=BD=E4=BB=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/finsh/msh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/finsh/msh.c b/components/finsh/msh.c index 5272f0728a4..7bf0a90f53d 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.);