From 77d5cd30eac6a7ba859863cd26d50fe6428d6520 Mon Sep 17 00:00:00 2001 From: "qiuyiuestc@gmail.com" Date: Wed, 3 Aug 2011 14:09:20 +0000 Subject: [PATCH] fix memory statistic error bug git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1659 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/slab.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/slab.c b/src/slab.c index 378faea1d..ceb6e8a3b 100644 --- a/src/slab.c +++ b/src/slab.c @@ -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); -- GitLab