mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #40066 from ahoppen/pr/deep-stack
[SourceKit] Use deep stack when parsing in the XPC service
This commit is contained in:
@@ -735,8 +735,17 @@ public:
|
||||
|
||||
void parseIfNeeded() {
|
||||
if (!IsParsed) {
|
||||
Parser->parse();
|
||||
IsParsed = true;
|
||||
// Perform parsing on a deep stack that's the same size as the main thread
|
||||
// during normal compilation to avoid stack overflows.
|
||||
static WorkQueue BigStackQueue{
|
||||
WorkQueue::Dequeuing::Concurrent,
|
||||
"SwiftDocumentSyntaxInfo::parseIfNeeded.BigStackQueue"};
|
||||
BigStackQueue.dispatchSync(
|
||||
[this]() {
|
||||
Parser->parse();
|
||||
IsParsed = true;
|
||||
},
|
||||
/*isStackDeep=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user