Skip to content

Commit

Permalink
libc/picolibc: Don't enable malloc by default
Browse files Browse the repository at this point in the history
When malloc is included in the build, the heap initialization code will be
pulled in even if the application doesn't actually use malloc. This
increases the size of executables by a few hundred bytes and delays system
startup.

Removing the 'imply COMMON_LIBC_MALLOC' statement from the PICOLIBC config
and require applications using malloc to explicitly depend on it.

Signed-off-by: Keith Packard <[email protected]>
  • Loading branch information
keith-packard committed Sep 28, 2023
1 parent c483bf6 commit 5667746
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/libc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ config PICOLIBC
select COMMON_LIBC_ABORT
select THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
select LIBC_ERRNO if THREAD_LOCAL_STORAGE
imply COMMON_LIBC_MALLOC
depends on !NATIVE_APPLICATION
depends on PICOLIBC_SUPPORTED
help
Expand Down

0 comments on commit 5667746

Please sign in to comment.