MCPcopy Create free account
hub / github.com/catchorg/Catch2 / FatalConditionHandler

Method FatalConditionHandler

extras/catch_amalgamated.cpp:4333–4342  ·  view source on GitHub ↗

For MSVC, we reserve part of the stack memory for handling memory overflow structured exception.

Source from the content-addressed store, hash-verified

4331 // For MSVC, we reserve part of the stack memory for handling
4332 // memory overflow structured exception.
4333 FatalConditionHandler::FatalConditionHandler() {
4334 ULONG guaranteeSize = static_cast<ULONG>(minStackSizeForErrors);
4335 if (!SetThreadStackGuarantee(&guaranteeSize)) {
4336 // We do not want to fully error out, because needing
4337 // the stack reserve should be rare enough anyway.
4338 Catch::cerr()
4339 << "Failed to reserve piece of stack."
4340 << " Stack overflows will not be reported successfully.";
4341 }
4342 }
4343
4344 // We do not attempt to unset the stack guarantee, because
4345 // Windows does not support lowering the stack size guarantee.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected