From bd11f44ab4660f0a42d43ed6c4e8268b2de6f99c Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Mon, 28 Sep 2009 07:06:29 +0000 Subject: [PATCH] fix the memory statistic issue in rt_realloc function. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@53 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mem.c b/src/mem.c index 4aeae0b589..37ad734a3d 100644 --- a/src/mem.c +++ b/src/mem.c @@ -371,9 +371,9 @@ void *rt_realloc(void *rmem, rt_size_t newsize) if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE < size) { -#if MEM_STATS +#ifdef RT_MEM_STATS used_mem -= (size - newsize); -#endif /* MEM_STATS */ +#endif ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize; mem2 = (struct heap_mem *)&heap_ptr[ptr2]; -- GitLab