1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

feat(nuttx): add memory dump for image cache heap (#6807)

Signed-off-by: p-zhangliming1 <p-zhangliming1@xiaomi.com>
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: p-zhangliming1 <p-zhangliming1@xiaomi.com>
This commit is contained in:
VIFEX 2024-09-06 13:32:42 +08:00 committed by GitHub
parent 650dba8650
commit 2cd6cc1efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}