On Tuesday, 29 June 2021 at 04:00:24 UTC, Vladimir Panteleev wrote:>
I recall that Pascal debug builds added manual checks for stack overflow. This was especially necessary in real mode, where a stack overflow would just crash the PC. I don't see why D couldn't do the same. It would be useful in protected mode with small variables too, as it would allow generating a normal D exception instead of a segmentation fault.
You could, if all your code is written in D, but D has to adapt stack layout to what FFI code expects. For instance, if 30% of your code is FFI, then you only detect 70% of stack overflows.