Skip to content

Commit c533bf3

Browse files
committed
Clear uniques via perRunCaches.
That lets this huge cache be cleared eagerly after a run is over rather than lazily when another run begins. This arrives pre-LGTMed by Important People.
1 parent ab63cca commit c533bf3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/reflect/scala/reflect/internal/Types.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,7 @@ trait Types extends api.Types { self: SymbolTable =>
38223822
Statistics.incCounter(rawTypeCount)
38233823
if (uniqueRunId != currentRunId) {
38243824
uniques = util.HashSet[Type]("uniques", initialUniquesCapacity)
3825+
perRunCaches.recordCache(uniques)
38253826
uniqueRunId = currentRunId
38263827
}
38273828
(uniques findEntryOrUpdate tp).asInstanceOf[T]

src/reflect/scala/reflect/internal/util/HashSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object HashSet {
1313
new HashSet[T](label, initialCapacity)
1414
}
1515

16-
class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] {
16+
class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] with collection.generic.Clearable {
1717
private var used = 0
1818
private var table = new Array[AnyRef](initialCapacity)
1919
private def index(x: Int): Int = math.abs(x % table.length)

0 commit comments

Comments
 (0)