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
This was brought up in #76 but the initial fix for the issue doesn't address it, so I'm spinning it off here.
When the RTOS scheduler starts we reserve the memory used for the pre-scheduler stack as "supervisor stack", but if scheduler never exits then we can probably clobber this memory and reuse it for heap.
Amount to potentially save is unclear. sdk_user_start has the stack at approx 0x3ffffce9, and the current high water mark when the scheduler starts is 0x3ffffc10. So potential saving may be ~217 bytes, or may be more if the ROM functions also allocate stack memory before calling user_start that can be reused.
Will need to tread carefully as some ROM functions may also make use of hard-coded memory regions at the top of memory here.
The task for someone to try is:
When the scheduler starts, set the stack limit to 0x3ffffce9 (or higher) and see if any memory corruption issues appear.
Devise automated tests to try and expose any likely memory corruption issues (context switches, calling ROM functions, etc.)
The text was updated successfully, but these errors were encountered:
This was brought up in #76 but the initial fix for the issue doesn't address it, so I'm spinning it off here.
When the RTOS scheduler starts we reserve the memory used for the pre-scheduler stack as "supervisor stack", but if scheduler never exits then we can probably clobber this memory and reuse it for heap.
Amount to potentially save is unclear. sdk_user_start has the stack at approx 0x3ffffce9, and the current high water mark when the scheduler starts is 0x3ffffc10. So potential saving may be ~217 bytes, or may be more if the ROM functions also allocate stack memory before calling user_start that can be reused.
Will need to tread carefully as some ROM functions may also make use of hard-coded memory regions at the top of memory here.
The task for someone to try is:
The text was updated successfully, but these errors were encountered: