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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-11-17 19:42:42 -05:00
parent 00680bd23a
commit d398e9631b
3 changed files with 14 additions and 1 deletions

View file

@ -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)

View file

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

View file

@ -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.