Skip to content

Commit fdfe832

Browse files
llext: add dynamic heap allocation support
Some applications require loading extensions into the memory which does not exist during the boot time and cannot be allocated statically. Make the application responsible for LLEXT heap allocation. Do not allocate LLEXT heap statically. Signed-off-by: Alex Ivanov <alexivanov@google.com>
1 parent 85b6ff0 commit fdfe832

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

subsys/llext/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ config LLEXT_BUILD_PIC
6060
most internal linking is performed by the linker at build time. Select "y"
6161
to make use of that advantage.
6262

63+
config LLEXT_HEAP_DYNAMIC
64+
bool "Do not allocate static LLEXT heap"
65+
default n
66+
help
67+
Some applications require loading extensions into the memory which does not
68+
exist during the boot time and cannot be allocated statically. Make the application
69+
responsible for LLEXT heap allocation. Do not allocate LLEXT heap statically.
70+
6371
config LLEXT_SHELL
6472
bool "llext shell commands"
6573
depends on SHELL

subsys/llext/llext_mem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ LOG_MODULE_DECLARE(llext, CONFIG_LLEXT_LOG_LEVEL);
2727
#define LLEXT_PAGE_SIZE 32
2828
#endif
2929

30+
#ifndef CONFIG_LLEXT_HEAP_DYNAMIC
3031
K_HEAP_DEFINE(llext_heap, CONFIG_LLEXT_HEAP_SIZE * 1024);
32+
#endif
3133

3234
/*
3335
* Initialize the memory partition associated with the specified memory region

0 commit comments

Comments
 (0)