From 2cd6cc1efc56dfdda9372ef7a5016f3f7de0d86c Mon Sep 17 00:00:00 2001 From: VIFEX Date: Fri, 6 Sep 2024 13:32:42 +0800 Subject: [PATCH] feat(nuttx): add memory dump for image cache heap (#6807) Signed-off-by: p-zhangliming1 Signed-off-by: pengyiqiang Co-authored-by: p-zhangliming1 --- src/drivers/nuttx/lv_nuttx_image_cache.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/drivers/nuttx/lv_nuttx_image_cache.c b/src/drivers/nuttx/lv_nuttx_image_cache.c index 93f59ed9a..964c67849 100644 --- a/src/drivers/nuttx/lv_nuttx_image_cache.c +++ b/src/drivers/nuttx/lv_nuttx_image_cache.c @@ -136,6 +136,19 @@ static bool defer_init(void) return true; } +static void heap_memdump(struct mm_heap_s * heap) +{ + struct mm_memdump_s dump = { + PID_MM_ALLOC, +#if CONFIG_MM_BACKTRACE >= 0 + 0, + ULONG_MAX +#endif + }; + + mm_memdump(heap, &dump); +} + static void * malloc_cb(size_t size_bytes, lv_color_format_t color_format) { LV_UNUSED(color_format); @@ -163,6 +176,7 @@ static void * malloc_cb(size_t size_bytes, lv_color_format_t color_format) bool evict_res = lv_cache_evict_one(img_cache_p, NULL); if(evict_res == false) { LV_LOG_ERROR("failed to evict one cache entry"); + heap_memdump(ctx->heap); return NULL; } }