Skip to content

Commit

Permalink
Make caches in 'ExtractAPI' use 'perRunCaches' #324
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Heine committed Jul 7, 2017
1 parent eda9d95 commit 9c5c75f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ class ExtractAPI[GlobalType <: Global](
// this cache reduces duplicate work both here and when persisting
// caches on other structures had minimal effect on time and cache size
// (tried: Definition, Modifier, Path, Id, String)
private[this] val typeCache = new HashMap[(Symbol, Type), xsbti.api.Type]
private[this] val typeCache = perRunCaches.newMap[(Symbol, Type), xsbti.api.Type]()
// these caches are necessary for correctness
private[this] val structureCache = new HashMap[Symbol, xsbti.api.Structure]
private[this] val classLikeCache = new HashMap[(Symbol, Symbol), xsbti.api.ClassLikeDef]
private[this] val pending = new HashSet[xsbti.api.Lazy[_]]
private[this] val structureCache = perRunCaches.newMap[Symbol, xsbti.api.Structure]()
private[this] val classLikeCache = perRunCaches.newMap[(Symbol, Symbol), xsbti.api.ClassLikeDef]()
private[this] val pending = perRunCaches.newSet[xsbti.api.Lazy[_]]()

private[this] val emptyStringArray = new Array[String](0)
private[this] val emptyStringArray = Array.empty[String]

private[this] val allNonLocalClassesInSrc = new HashSet[xsbti.api.ClassLike]
private[this] val _mainClasses = new HashSet[String]
private[this] val allNonLocalClassesInSrc = perRunCaches.newSet[xsbti.api.ClassLike]()
private[this] val _mainClasses = perRunCaches.newSet[String]()

/**
* Implements a work-around for https://github.com/sbt/sbt/issues/823
Expand Down

0 comments on commit 9c5c75f

Please sign in to comment.