Re:Regex Parser in C Using Continuation Passing
by burntsushi on Saturday December 23, 2017 @08:21AM
(#15994049)
> 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.
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.