Stack overflow handling on windows


#1

Right now for windows we insert a prologue in every function that does stack overflow checks. Windows already has a built in more efficient way of doing this via virtual protected guard pages at the bottom of the stack that trigger an exception that we can catch and handle. We should switch to this method.


#2

I agree. Windows provides pretty sophisticated stack safety mechanisms, and we get them for free. I think we need SEH though?


#3

Well yes, we’d have to switch to using SEH for our exception mechanism. We already need SEH anyway to get 64-bit Rust working properly on Windows, so we can switch to SEH for 32-bit as well while we’re at it.