samples: basic: hash_map: fix libc heap size setting

The malloc arena/heap size setting can be adjusted using different
Kconfig options, depending on the libc implementation. This means
prj.conf can't be used to set this value on projects that can be built
for multiple libcs without generating a Kconfig warning.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2023-07-26 13:05:52 +02:00 committed by Carles Cufí
parent 47515f4d7b
commit 7ef8911e8c
2 changed files with 7 additions and 2 deletions

View file

@ -6,8 +6,6 @@ CONFIG_BOOT_BANNER=n
CONFIG_LOG=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
CONFIG_SYS_HASH_FUNC32=y
CONFIG_SYS_HASH_MAP=y

View file

@ -25,11 +25,13 @@ tests:
libraries.hash_map.minimal.separate_chaining.djb2:
extra_configs:
- CONFIG_MINIMAL_LIBC=y
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_SC=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.minimal.open_addressing.djb2:
extra_configs:
- CONFIG_MINIMAL_LIBC=y
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_OA_LP=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
# Newlib
@ -37,18 +39,21 @@ tests:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
- CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_SC=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.newlib.open_addressing.djb2:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
- CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_OA_LP=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.newlib.cxx_unordered_map.djb2:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
- CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_CXX=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
- CONFIG_MAIN_STACK_SIZE=2048
@ -56,10 +61,12 @@ tests:
libraries.hash_map.picolibc.separate_chaining.djb2:
extra_configs:
- CONFIG_PICOLIBC=y
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_SC=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.picolibc.open_addressing.djb2:
extra_configs:
- CONFIG_PICOLIBC=y
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_OA_LP=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y