mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-api-digester: initialize vector with a reasonable capacity.
In Jenkins bot, we've seen "exception std::length_error: vector" for api-digester tests. Tentatively, this patch initializes a major vector with a reasonably large size, which may avoid its wild capacity growth.
This commit is contained in:
@@ -166,10 +166,12 @@ typedef std::map<NodePtr, NodePtr> ParentMap;
|
||||
typedef std::vector<NodePtr> NodeVector;
|
||||
|
||||
class SDKContext {
|
||||
unsigned SIZE = 1024 * 1024;
|
||||
llvm::StringSet<> TextData;
|
||||
std::vector<std::unique_ptr<SDKNode>> OwnedNodes;
|
||||
|
||||
public:
|
||||
SDKContext() : OwnedNodes(SIZE) {}
|
||||
SDKNode* own(SDKNode *Node) {
|
||||
assert(Node);
|
||||
OwnedNodes.emplace_back(Node);
|
||||
|
||||
Reference in New Issue
Block a user