Skip to content

Commit c822431

Browse files
committed
[nrf noup] Switch to statically allocated heap
Use malloc/free replacements based on statically allocated Zephyr's sys_heap to provide better control of RAM usage. Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
1 parent bf71884 commit c822431

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

config/nrfconnect/chip-module/Kconfig

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ config CHIP_DEBUG_SYMBOLS
7575
help
7676
Build the application with debug symbols.
7777

78+
config CHIP_MALLOC_SYS_HEAP
79+
default y
80+
7881
config CHIP_FACTORY_DATA
7982
bool "Enable Factory Data support"
8083
select ZCBOR

config/nrfconnect/chip-module/Kconfig.defaults

-5
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ config NEWLIB_LIBC_NANO
8585
bool
8686
default y
8787

88-
# Warn a user if memory left for the heap is too small
89-
config NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE
90-
int
91-
default 12288 # 12kB
92-
9388
# Generic networking options
9489
config NET_SOCKETS_POSIX_NAMES
9590
bool

config/zephyr/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ config CHIP_MALLOC_SYS_HEAP_OVERRIDE
215215

216216
config CHIP_MALLOC_SYS_HEAP_SIZE
217217
int "Heap size used by memory allocator based on Zephyr sys_heap"
218-
default 16384 # 16kB
218+
default 10240 # 10kB
219219
help
220220
This value controls how much of the device RAM is reserved for the heap
221221
used by the memory allocation functions based on sys_heap from Zephyr

0 commit comments

Comments
 (0)