For MSVC, we reserve part of the stack memory for handling memory overflow structured exception.
| 10815 | // For MSVC, we reserve part of the stack memory for handling |
| 10816 | // memory overflow structured exception. |
| 10817 | FatalConditionHandler::FatalConditionHandler() { |
| 10818 | ULONG guaranteeSize = static_cast<ULONG>(minStackSizeForErrors); |
| 10819 | if (!SetThreadStackGuarantee(&guaranteeSize)) { |
| 10820 | // We do not want to fully error out, because needing |
| 10821 | // the stack reserve should be rare enough anyway. |
| 10822 | Catch::cerr() |
| 10823 | << "Failed to reserve piece of stack." |
| 10824 | << " Stack overflows will not be reported successfully."; |
| 10825 | } |
| 10826 | } |
| 10827 | |
| 10828 | // We do not attempt to unset the stack guarantee, because |
| 10829 | // Windows does not support lowering the stack size guarantee. |