Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/finsh/msh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.);
Expand Down