9 ms·
Can C gracefully recover from running out of stack space?
by craftkiller 9mo ago
Can C gracefully recover from running out of stack space?
- fulafel 9mo agoDepends 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).
- kibwen 9mo agoOr in short: no, C is no better than Rust at gracefully recovering from stack overflow, either in theory or in practice.
- deleted 9mo ago[deleted]