3 ms·
gcc supports auto-generating stack overflow checks. You can implement your own handler for a stack overflow, allowing allocation of additional stack space whic
by Peaker 9y ago
gcc supports auto-generating stack overflow checks.
You can implement your own handler for a stack overflow, allowing allocation of additional stack space which can be chained to the original stack. This is how some language runtimes handle [or used to handle] segmented stacks that grow on demand.
- burntsushi 9y ago> gcc supports auto-generating stack overflow checks. I don't know what that means. I don't see how auto-generated code would fix my problem. The regex parser should return an error to the caller if the regex exceeds some limit. Dynamically growing the stack sounds like a cute hack. I doubt I'd consider it superior to just using the heap though.
- Peaker 9y agoYou can use that to make stack overflow a (relatively) graceful error instead of a segfault.