From d398e9631bfbfee5e2dc1b42c426ef98b928ea7e Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 17 Nov 2023 19:42:42 -0500 Subject: [PATCH] lib: heap: build heap_info conditionally Only build when needed and adapt existing users to pull this in when needed. Signed-off-by: Anas Nashif --- lib/heap/CMakeLists.txt | 2 +- lib/heap/Kconfig | 12 ++++++++++++ modules/lvgl/Kconfig.memory | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/heap/CMakeLists.txt b/lib/heap/CMakeLists.txt index 58fc62fa82b..0224a864dcb 100644 --- a/lib/heap/CMakeLists.txt +++ b/lib/heap/CMakeLists.txt @@ -2,10 +2,10 @@ zephyr_sources( heap.c - heap_info.c multi_heap.c ) +zephyr_sources_ifdef(CONFIG_SYS_HEAP_INFO heap_info.c) zephyr_sources_ifdef(CONFIG_SYS_HEAP_VALIDATE heap_validate.c) zephyr_sources_ifdef(CONFIG_SYS_HEAP_STRESS heap_stress.c) zephyr_sources_ifdef(CONFIG_SHARED_MULTI_HEAP shared_multi_heap.c) diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 2dda1d197e2..8a79bea77d9 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -13,11 +13,23 @@ config SYS_HEAP_VALIDATE environments that require sensitive detection of memory corruption. + Use for testing and validation only. + config SYS_HEAP_STRESS bool "General purpose heap stress test" help Stresses the heap. + Use for testing and validation only. + +config SYS_HEAP_INFO + bool "Heap internal structure information" + help + Enables support for printing heap internal structure + information to the console. + + Use for debugging only. + config SYS_HEAP_ALLOC_LOOPS int "Number of tries in the inner heap allocation loop" default 3 diff --git a/modules/lvgl/Kconfig.memory b/modules/lvgl/Kconfig.memory index fc59eccb2e3..6cb1b197d9d 100644 --- a/modules/lvgl/Kconfig.memory +++ b/modules/lvgl/Kconfig.memory @@ -26,6 +26,7 @@ choice LV_Z_MEMORY_POOL config LV_Z_MEM_POOL_SYS_HEAP bool "User space lvgl pool" + select SYS_HEAP_INFO help Use a dedicated memory pool from a private sys heap.