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
we currently have the heap hardcoded to 32KB. this is quite small, especially for async, because each async task is essentially moving a bit of stack into the heap.
@jamesmunns looked at the esp32c3-hal crate's linker script and determined that the memory region used for the stack and heap is 300KB.
we could probably get away with at least a 64KB heap before we have a significant danger of getting clobbered by a rogue stack frame. even 100KB is probably fine...
The text was updated successfully, but these errors were encountered:
the memory region used for the stack and heap is 300KB.
That's for now.
The region is also used for statics, and I have no idea if code size factors into it. Since heap + stack is "whatever you didn't use for other stuff", that size is likely to decrease as time goes on.
Something we COULD do is figure out how to modify/extend the esp32c3 linker scripts, in particular to:
Set the size of heap, so it becomes a "stronger" reservation
Set a MINIMUM stack size reservation
Assert at link time that the heap size + min stack size don't overflow the memory region, giving us a link-time error if these assertions fail.
Until we have something like cargo-call-stack, the minimum stack size is going to be a best estimate, but that is better than the current "lol cross your fingers" approach.
we currently have the heap hardcoded to 32KB. this is quite small, especially for async, because each async task is essentially moving a bit of stack into the heap.
@jamesmunns looked at the
esp32c3-hal
crate's linker script and determined that the memory region used for the stack and heap is 300KB.we could probably get away with at least a 64KB heap before we have a significant danger of getting clobbered by a rogue stack frame. even 100KB is probably fine...
The text was updated successfully, but these errors were encountered: