3 ms·
> The stack memory is somewhat tricky to allocate, because its maximum size is determined at runtime. > > There is no silver bullet: we can’t predict it. So
by matthews2 5y ago
> The stack memory is somewhat tricky to allocate, because its maximum size is determined at runtime.
>
> There is no silver bullet: we can’t predict it. So we need to measure it.
When you're extremely memory constrained, you should probably know the max stack depth at different points in your program.
GCC has -Wstack-usage=BYTES to warn you if a single function uses more than BYTES of stack space (VLAs and alloca not included), which admittedly isn't too useful if your function calls another...
- deleted 5y ago[deleted]