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
This commit is contained in:
parent
6a26038b16
commit
bd11f44ab4
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue