Skip to content

Commit 70859e8

Browse files
authored
Merge pull request swiftlang#34072 from kubamracek/larger-stack-for-mib
When building modules on secondary threads via RunSafelyOnThread, request 8 MB of stack
2 parents 1f54f96 + a20118b commit 70859e8

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)