From e6738a26178022c19685745cc423d49bedf3256a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 28 Oct 2020 14:58:44 +0100 Subject: [PATCH] remove debug code --- src/lv_misc/lv_mem.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index 6c5817bc5..c41ea98eb 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -171,17 +171,16 @@ void * lv_mem_alloc(size_t size) void * alloc = NULL; #if LV_MEM_CUSTOM == 0 - - lv_mem_monitor_t mon; - lv_mem_monitor(&mon); + static uint32_t defr = 0; + defr++; + if(defr > LV_MEM_FULL_DEFRAG_CNT) { + defr = 0; + lv_mem_defrag(); + } alloc = alloc_core(size); - printf("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d\n", - (int)mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct, - (int)mon.free_biggest_size); - lv_mem_defrag(); - if(alloc == NULL) { LV_LOG_WARN("Perform defrag"); + lv_mem_monitor_t mon; lv_mem_monitor(&mon); printf("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d\n",