fix memory statistic error bug

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1659 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
qiuyiuestc@gmail.com 2011-08-03 14:09:20 +00:00
parent 01292bb587
commit 77d5cd30ea
1 changed files with 0 additions and 11 deletions

View File

@ -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);