Skip to content

Commit 20a341d

Browse files
author
Deepika
committed
Add more information and comments
1 parent 56154c0 commit 20a341d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

platform/mbed_retarget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,12 @@ extern "C" WEAK void __cxa_pure_virtual(void)
12421242

12431243
#if defined(MBED_SPLIT_HEAP)
12441244

1245+
// Default RAM memory used for heap
12451246
extern uint32_t __mbed_sbrk_start;
12461247
extern uint32_t __mbed_krbs_start;
1248+
/* Additional RAM memory used for heap - please note this
1249+
* address should be lower address then the previous default address
1250+
*/
12471251
extern uint32_t __mbed_sbrk_start_0;
12481252
extern uint32_t __mbed_krbs_start_0;
12491253

@@ -1256,6 +1260,7 @@ extern "C" WEAK caddr_t _sbrk(int incr)
12561260

12571261
/**
12581262
* If the new address is outside the first region, start allocating from the second region.
1263+
* Jump to second region is done just once, and `static bool once` is used to keep track of that.
12591264
*/
12601265
if (once && (new_heap > (uint32_t) &__mbed_krbs_start_0)) {
12611266
once = false;

0 commit comments

Comments
 (0)