Skip to content

Commit 6c16b34

Browse files
stephanosiocfriedt
authored andcommitted
lib: libc: minimal: Initialise libc heap during POST_KERNEL phase
This commit changes the invocation of the minimal libc malloc initialisation function such that it is executed during the POST_KERNEL phase instead of the APPLICATION phase. This is necessary in order to ensure that the application initialisation functions (i.e. the functions called during the APPLICATIION phase) can make use of the libc heap. Signed-off-by: Stephanos Ioannidis <[email protected]> (cherry picked from commit db0748c)
1 parent 1831431 commit 6c16b34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/libc/minimal/source/stdlib/malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void free(void *ptr)
9494
(void) sys_mutex_unlock(&z_malloc_heap_mutex);
9595
}
9696

97-
SYS_INIT(malloc_prepare, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
97+
SYS_INIT(malloc_prepare, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
9898
#else /* No malloc arena */
9999
void *malloc(size_t size)
100100
{

0 commit comments

Comments
 (0)