From 5e34cf4f88844b16dcca5aadce9696c60802eebc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 2 Jun 2006 14:36:18 +0000 Subject: some changes to plug space leaks --- src/compiler/scala/tools/nsc/Main.scala | 18 +++++++++++++++--- src/compiler/scala/tools/nsc/Phase.scala | 12 ------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala index 62fb2a0bdb..df27b1a738 100644 --- a/src/compiler/scala/tools/nsc/Main.scala +++ b/src/compiler/scala/tools/nsc/Main.scala @@ -32,12 +32,22 @@ object Main extends Object with EvalLoop { def errors() = reporter.errors - def resident(compiler: Global): unit = { - loop(line => { + def resident(compiler: Global): unit = + loop { line => val args = List.fromString(line, ' ') val command = new CompilerCommand(args, error, true) (new compiler.Run) compile command.files - }) + } + + def forever(compiler: Global): unit = { + var cnt = 0 + while (true) { + Console.println("Iteration: "+cnt) + cnt = cnt + 1 + val args = List("Global.scala") + val command = new CompilerCommand(args, error, true) + (new compiler.Run) compile command.files + } } def process(args: Array[String]): unit = { @@ -51,6 +61,8 @@ object Main extends Object with EvalLoop { else { try { object compiler extends Global(command.settings, reporter); + if (command.settings.Xgenerics.value) + forever(compiler) if (command.settings.resident.value) resident(compiler) else if (command.files.isEmpty) diff --git a/src/compiler/scala/tools/nsc/Phase.scala b/src/compiler/scala/tools/nsc/Phase.scala index d863e2a5fd..4ca3aa2e9c 100644 --- a/src/compiler/scala/tools/nsc/Phase.scala +++ b/src/compiler/scala/tools/nsc/Phase.scala @@ -7,20 +7,8 @@ package scala.tools.nsc; import symtab.Flags; -object Phase { - var phaseCount = 0; - -} - abstract class Phase(val prev: Phase) { - Phase.phaseCount = Phase.phaseCount + 1 - Console.println("creating phase: "+Phase.phaseCount) - override def finalize() = { - Phase.phaseCount = Phase.phaseCount - 1 - Console.println("collecting phase: "+Phase.phaseCount) - } - type Id = int; val id: Id = if (prev == null) 0 else prev.id + 1; -- cgit v1.2.3