mm: fix memory statistics error

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
yinshengkai 2023-11-14 22:19:52 +08:00 committed by Xiang Xiao
parent 79eab8783f
commit 8fecd0385b
1 changed files with 3 additions and 4 deletions

View File

@ -500,10 +500,6 @@ static void mm_delayfree(FAR struct mm_heap_s *heap, FAR void *mem,
kasan_poison(mem, size);
/* Update heap statistics */
heap->mm_curused -= size;
/* Pass, return to the tlsf pool */
if (delay)
@ -512,6 +508,9 @@ static void mm_delayfree(FAR struct mm_heap_s *heap, FAR void *mem,
}
else
{
/* Update heap statistics */
heap->mm_curused -= mm_malloc_size(heap, mem);
sched_note_heap(false, heap, mem, size);
tlsf_free(heap->mm_tlsf, mem);
}