summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-02-01 16:18:25 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-02-01 16:18:25 +0000
commit2ebde52602cdb6751feff04fa8136171603578b7 (patch)
tree47a399102833f459ca597e2b4d5aa0e6e2bc1db5
parentcaf436d96fda91365295035297bbf8cec4bd4da1 (diff)
downloadscala-2ebde52602cdb6751feff04fa8136171603578b7.tar.gz
scala-2ebde52602cdb6751feff04fa8136171603578b7.tar.bz2
scala-2ebde52602cdb6751feff04fa8136171603578b7.zip
Remove the currentRun after a build, inside the...
Remove the currentRun after a build, inside the build manager. review by plocinic.
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala8
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index b3fc762435..b132b47417 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -645,6 +645,14 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
private var curRun: Run = null
private var curRunId = 0
+ /** Remove the current run when not needed anymore. Used by the build
+ * manager to save on the memory foot print. The current run holds on
+ * to all compilation units, which in turn hold on to trees.
+ */
+ private [nsc] def dropRun() {
+ curRun = null
+ }
+
/** The currently active run
*/
def currentRun: Run = curRun
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 73c8445fb7..5e20656c94 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -180,6 +180,8 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
}
update0(files)
+ // remove the current run in order to save some memory
+ compiler.dropRun()
}
// Attempt to break the cycling reference deps as soon as possible and reduce