未验证 提交 4c399f88 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #4192 from Jedcheen/master

add rt_memory_info() for memheap.c
......@@ -712,6 +712,20 @@ void *rt_calloc(rt_size_t count, rt_size_t size)
}
RTM_EXPORT(rt_calloc);
void rt_memory_info(rt_uint32_t *total,
rt_uint32_t *used,
rt_uint32_t *max_used)
{
if (total != RT_NULL)
*total = _heap.pool_size;
if (used != RT_NULL)
*used = _heap.pool_size - _heap.available_size;
if (max_used != RT_NULL)
*max_used = _heap.max_used_size;
}
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册