Skip to content

Commit

Permalink
core: register main heap first
Browse files Browse the repository at this point in the history
Swap heap1 and heap2 malloc pools registration in init_runtime()
(case CFG_WITH_PAGER=y) since heap2 is the main heap part, heap1
being always < 4kB. This change ensures the first heap pool registered
into bget is large enough regarding bget initial pool constraint while
heap2 might to too small for that purpose.

Signed-off-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
etienne-lms authored and jforissier committed Sep 14, 2021
1 parent a83ee50 commit ee893ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/arch/arm/kernel/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ static void init_runtime(unsigned long pageable_part)

init_asan();

malloc_add_pool(__heap1_start, __heap1_end - __heap1_start);
/* Add heap2 first as heap1 may be too small as initial bget pool */
malloc_add_pool(__heap2_start, __heap2_end - __heap2_start);
malloc_add_pool(__heap1_start, __heap1_end - __heap1_start);

/*
* This needs to be initialized early to support address lookup
Expand Down

0 comments on commit ee893ff

Please sign in to comment.