|
|
|
|
|
by tliltocatl
539 days ago
|
|
Not mentioned: do not do any dynamic allocation at all. Never ever. Everything is either a global variable or goes on the stack. Doesn't work when you need to handle unknown input size, but when you need to make sure you don't OOM ever, it's the only way. Stack overflow is still a possibility, unfortunately, because existing languages cannot provide any guarantee here (Zig tried, but didn't got it done afair). The only real problem with this approach is code reuse, because library writers will insist on opaque structs and malloc rather than letting the caller allocate. |
|
https://www.absint.com/astree/index.htm
None make any mention of stack exhaustion that I can find in a cursory search.