summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-22 03:42:20 +0000
committerPaul Phillips <paulp@improving.org>2010-12-22 03:42:20 +0000
commit1050387558c4d16dd7427916e59b4824c4f70063 (patch)
tree24fccbb1366552cbf91141f92c0f3d3a48d214d9 /src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
parent5bc2fc576949f03980ddd092b303b4484ab3172c (diff)
downloadscala-1050387558c4d16dd7427916e59b4824c4f70063.tar.gz
scala-1050387558c4d16dd7427916e59b4824c4f70063.tar.bz2
scala-1050387558c4d16dd7427916e59b4824c4f70063.zip
The undoLog is being cleared before a typer run...
The undoLog is being cleared before a typer run, but not afterward. This meant a huge amount of unnecessary garbage persisted beyond typer. Now, more clearing. Review by moors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Analyzer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Analyzer.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
index c0b4ab5ca5..56f1fd4c53 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
@@ -76,10 +76,17 @@ trait Analyzer extends AnyRef
def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) {
override def keepsTypeParams = false
resetTyper()
+ // the log accumulates entries over time, even though it should not (Adriaan, Martin said so).
+ // Lacking a better fix, we clear it here (before the phase is created, meaning for each
+ // compiler run). This is good enough for the resident compiler, which was the most affected.
+ undoLog.clear()
override def run {
val start = startTimer(typerNanos)
global.echoPhaseSummary(this)
currentRun.units foreach applyPhase
+ undoLog.clear()
+ // need to clear it after as well or 10K+ accumulated entries are
+ // uncollectable the rest of the way.
stopTimer(typerNanos, start)
}
def apply(unit: CompilationUnit) {