Skip to content

Commit

Permalink
Merge pull request #41221 from prakanth97/2201.7.2-stage_41207
Browse files Browse the repository at this point in the history
[2201.7.2-stage] Cleanup memory usage of ConstantValueResolver
  • Loading branch information
hasithaa authored Aug 17, 2023
2 parents 056ec03 + 4e7e1f4 commit 843ee27
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ public void resolve(List<BLangConstant> constants, PackageID packageID, SymbolEn
this.createdTypeDefinitions.clear();
}

private void reset() {
unresolvedConstants.clear();
constantMap.clear();
resolvingConstants.clear();
unresolvableConstants.clear();
createdTypeDefinitions.clear();
}

@Override
public void visit(BLangConstant constant) {
if (!unresolvedConstants.containsKey(constant.symbol)) {
Expand Down Expand Up @@ -579,6 +587,7 @@ BLangConstantValue constructBLangConstantValueWithExactType(BLangExpression expr

this.anonTypeNameSuffixes = anonTypeNameSuffixes;
updateConstantType(constantSymbol, expression, env);
reset();
return value;
}

Expand Down

0 comments on commit 843ee27

Please sign in to comment.