| 74 | |
| 75 | #ifdef RT_USING_HEAP |
| 76 | static 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 | } |
| 92 | MSH_CMD_EXPORT_ALIAS(cmd_free, free, Show the memory usage in the system); |
| 93 | #endif /* RT_USING_HEAP */ |
| 94 |
no test coverage detected