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

you understand that stack allocation can OOM too?




Can C gracefully recover from running out of stack space?

Depends on your definition of graceful but the C standard doesn't preclude handling it and there's POSIX interfaces such as sigaltstack / sigsetjmp etc that fit and indeed some code like language runtimes use this to react to stack exhaustion (having first set up guard pages etc).

Or in short: no, C is no better than Rust at gracefully recovering from stack overflow, either in theory or in practice.



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

Search: