summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2010-11-15 17:09:25 +0000
committerIulian Dragos <jaguarul@gmail.com>2010-11-15 17:09:25 +0000
commit6292877281f8bf4ec5f52cf8d388382a8c4c8fcf (patch)
treed36708bf8bcf0fb8d756003bda44d5ce773d7fb9
parenta3c0cdc9db4de255c93f817bd92db9fed531c085 (diff)
downloadscala-6292877281f8bf4ec5f52cf8d388382a8c4c8fcf.tar.gz
scala-6292877281f8bf4ec5f52cf8d388382a8c4c8fcf.tar.bz2
scala-6292877281f8bf4ec5f52cf8d388382a8c4c8fcf.zip
Clear the undoLog for types in resetTyper.
a memory leak when running scalac in resident mode (including the presentation compiler and build manager). no review.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 6a91286c73..a897bb14a4 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -102,7 +102,7 @@ trait Types extends reflect.generic.Types { self: SymbolTable =>
*/
object undoLog {
private type UndoLog = List[(TypeVar, TypeConstraint)]
- private var log: UndoLog = List()
+ private[nsc] var log: UndoLog = List()
/** Undo all changes to constraints to type variables upto `limit'
*/
@@ -115,7 +115,7 @@ trait Types extends reflect.generic.Types { self: SymbolTable =>
}
private[Types] def record(tv: TypeVar) = {log = (tv, tv.constr.cloneInternal) :: log}
- private[Types] def clear() { log = List() } // TODO: what's the point of this method? -- we roll back the log (using undoTo) in the combinators below anyway, see comments at clear() calls below
+ private[nsc] def clear() { log = List() } // TODO: what's the point of this method? -- we roll back the log (using undoTo) in the combinators below anyway, see comments at clear() calls below
// `block` should not affect constraints on typevars
def undo[T](block: => T): T = {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index fc1ec8e5e5..8a9f9916d0 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -46,6 +46,7 @@ trait Typers { self: Analyzer =>
resetImplicits()
transformed.clear
superDefs.clear
+ undoLog.clear
}
object UnTyper extends Traverser {