You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _sbrk() implementation added previously refuses to overwrite the
stack, but will still happily allocate all other memory, leaving none to
expand the stack into. Since the stack can expand over the heap
undetected, this changes sbrk() to leave a safety margin between the
heap and the stack (at the time of the malloc/_sbrk call). The size of
this margin can be configured (by the sketch) by changing the
`__malloc_margin` global variable, it defaults to 64 bytes.
This approach (both having a margin and making it configurable with the
`__malloc_margin`) is copied from the avr-libc malloc implementation,
see:
https://onlinedocs.microchip.com/pr/GUID-317042D4-BCCE-4065-BB05-AC4312DBC2C4-en-US-2/index.html?GUID-27757112-8BE1-49C2-B023-CD94AD06C5E2
avr-libc uses a default margin of 32 bytes, but given the bigger integer
and pointer size on ARM, this is doubled for this core.
0 commit comments