diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-05 01:28:59 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-05 01:28:59 -0700 |
commit | a05a68a9894f78fc8d7423c722e516a7ee49d559 (patch) | |
tree | 4da8e341ceae973ed1d3aab8ce89e37aa13eb095 | |
parent | fb9dad23be85763ff70e256bc76617e14f13c950 (diff) | |
parent | c533bf30a4637499cd5344434445e4615615b6b1 (diff) | |
download | scala-a05a68a9894f78fc8d7423c722e516a7ee49d559.tar.gz scala-a05a68a9894f78fc8d7423c722e516a7ee49d559.tar.bz2 scala-a05a68a9894f78fc8d7423c722e516a7ee49d559.zip |
Merge pull request #1049 from paulp/uniques-per-run
Clear uniques via perRunCaches.
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/util/HashSet.scala | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 442a91774d..386d2896be 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -3822,6 +3822,7 @@ trait Types extends api.Types { self: SymbolTable => Statistics.incCounter(rawTypeCount) if (uniqueRunId != currentRunId) { uniques = util.HashSet[Type]("uniques", initialUniquesCapacity) + perRunCaches.recordCache(uniques) uniqueRunId = currentRunId } (uniques findEntryOrUpdate tp).asInstanceOf[T] diff --git a/src/reflect/scala/reflect/internal/util/HashSet.scala b/src/reflect/scala/reflect/internal/util/HashSet.scala index a771dad2b0..cd1fe2e9f3 100644 --- a/src/reflect/scala/reflect/internal/util/HashSet.scala +++ b/src/reflect/scala/reflect/internal/util/HashSet.scala @@ -13,7 +13,7 @@ object HashSet { new HashSet[T](label, initialCapacity) } -class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] { +class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] with collection.generic.Clearable { private var used = 0 private var table = new Array[AnyRef](initialCapacity) private def index(x: Int): Int = math.abs(x % table.length) |