Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With non-trivial functions and modern compilers, that gives you an upper bound that may differ significantly from the actual stack usage.

There is no requirement for the compiler to keep the memory of all locals distinct.

On more powerful CPUs, chances also are a large fraction of the locals never makes it onto the stack, but stays in registers.

Having said that, compilers for embedded CPUs used to be fairly bad at optimizations (wouldn’t know of that has changed in the past decades)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: