summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeung Lai Yung <benkerbuild@gmail.com>2022-05-22 13:25:53 +0000
committerDamjan Marion <dmarion@me.com>2022-05-24 14:04:06 +0000
commit69be0899007aee49744b2dbee957607503df5e83 (patch)
tree703d6dcdf11edd76d200c21a7682fa22d6cbc72c
parente71492655fab8a70285b3dcf1419420a337750f9 (diff)
vppinfra: fix memory trace
Type: fix reset the memory trace if mem trace is turned on Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com> Change-Id: Ib99355b9ed42ff66c720bbea5cbbf03c65820d12
-rw-r--r--src/vppinfra/mem_dlmalloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c
index ffffec8e441..25014c8ec78 100644
--- a/src/vppinfra/mem_dlmalloc.c
+++ b/src/vppinfra/mem_dlmalloc.c
@@ -698,6 +698,11 @@ clib_mem_heap_realloc_aligned (void *heap, void *p, uword new_size,
mspace_realloc_in_place (h->mspace, p, new_size))
{
clib_mem_unpoison (p, new_size);
+ if (PREDICT_FALSE (h->flags & CLIB_MEM_HEAP_F_TRACED))
+ {
+ mheap_put_trace (pointer_to_uword (p), old_alloc_size);
+ mheap_get_trace (pointer_to_uword (p), clib_mem_size (p));
+ }
}
else
{