mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Count constraint-solving memory more precisely, rdar://29684330
This commit is contained in:
@@ -1650,3 +1650,16 @@ Type Solution::simplifyType(Type type) const {
|
||||
return known->second;
|
||||
});
|
||||
}
|
||||
|
||||
size_t Solution::getTotalMemory() const {
|
||||
return sizeof(*this) +
|
||||
typeBindings.getMemorySize() +
|
||||
overloadChoices.getMemorySize() +
|
||||
ConstraintRestrictions.getMemorySize() +
|
||||
llvm::capacity_in_bytes(Fixes) +
|
||||
DisjunctionChoices.getMemorySize() +
|
||||
OpenedTypes.getMemorySize() +
|
||||
OpenedExistentialTypes.getMemorySize() +
|
||||
(DefaultedConstraints.size() * sizeof(void*));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user