From a41f4223de5123d90264f2eb9843f218153c59fb Mon Sep 17 00:00:00 2001 From: PoweredByPie Date: Sat, 18 May 2024 06:44:52 -0700 Subject: [PATCH] Use setStackSize on Windows --- src/nix/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nix/main.cc b/src/nix/main.cc index bc13a4df5..d3f3324ac 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -522,10 +522,13 @@ void mainWrapped(int argc, char * * argv) int main(int argc, char * * argv) { -#ifndef _WIN32 // TODO implement on Windows +#ifndef _WIN32 // Increase the default stack size for the evaluator and for // libstdc++'s std::regex. nix::setStackSize(64 * 1024 * 1024); +#else + // Windows' default stack reservation is 1 MB, going over will fail + nix::setStackSize(1 * 1024 * 1024); #endif return nix::handleExceptions(argv[0], [&]() {