提交 77d5cd30 编写于 作者: qiuyiuestc's avatar qiuyiuestc

fix memory statistic error bug

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1659 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 01292bb5
......@@ -257,11 +257,6 @@ void *rt_page_alloc(rt_size_t npages)
}
}
#ifdef RT_MEM_STATS
used_mem += npages * RT_MM_PAGE_SIZE;
if (used_mem > max_mem) max_mem = used_mem;
#endif
/* unlock heap */
rt_sem_release(&heap_sem);
......@@ -282,12 +277,6 @@ void rt_page_free(void *addr, rt_size_t npages)
/* lock heap */
rt_sem_take(&heap_sem, RT_WAITING_FOREVER);
/* update memory usage */
#ifdef RT_MEM_STATS
if(rt_page_list != RT_NULL)
used_mem -= npages * RT_MM_PAGE_SIZE;
#endif
for (prev = &rt_page_list; (b = *prev) != RT_NULL; prev = &(b->next))
{
RT_ASSERT(b->page > 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册