Skip to content

Commit a20118b

Browse files
committed
When building modules on secondary threads via RunSafelyOnThread, request 8 MB of stack
1 parent 8e16b25 commit a20118b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Frontend/ModuleInterfaceBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
153153
auto outerPrettyStackState = llvm::SavePrettyStackState();
154154

155155
bool SubError = false;
156+
static const size_t ThreadStackSize = 8 << 20; // 8 MB.
156157
bool RunSuccess = llvm::CrashRecoveryContext().RunSafelyOnThread([&] {
157158
// Pretend we're on the original thread for pretty-stack-trace purposes.
158159
auto savedInnerPrettyStackState = llvm::SavePrettyStackState();
@@ -265,7 +266,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
265266
}
266267
return std::error_code();
267268
});
268-
});
269+
}, ThreadStackSize);
269270
return !RunSuccess || SubError;
270271
}
271272

0 commit comments

Comments
 (0)