diff options
author | michelou <michelou@epfl.ch> | 2011-11-23 18:25:08 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2011-11-23 18:25:08 +0000 |
commit | 667227b796fb2601363b6b7c0763b0e739a0edb2 (patch) | |
tree | d9f04ceeac8ca80204cd1bcc21b6bd40d842094e /src/compiler/scala/tools/ant/sabbus | |
parent | 23d7024e717a085a446c067efa28e371717119ac (diff) | |
download | scala-667227b796fb2601363b6b7c0763b0e739a0edb2.tar.gz scala-667227b796fb2601363b6b7c0763b0e739a0edb2.tar.bz2 scala-667227b796fb2601363b6b7c0763b0e739a0edb2.zip |
fixed deprecated number syntax
Diffstat (limited to 'src/compiler/scala/tools/ant/sabbus')
-rw-r--r-- | src/compiler/scala/tools/ant/sabbus/Compilers.scala | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/ant/sabbus/Compilers.scala b/src/compiler/scala/tools/ant/sabbus/Compilers.scala index 4b21428674..843ee043ea 100644 --- a/src/compiler/scala/tools/ant/sabbus/Compilers.scala +++ b/src/compiler/scala/tools/ant/sabbus/Compilers.scala @@ -24,22 +24,23 @@ object Compilers extends collection.DefaultMap[String, Compiler] { override def size = container.size def make(id: String, classpath: Array[URL], settings: Settings): Compiler = { - val runtime = Runtime.getRuntime if (debug) println("Making compiler " + id) - if (debug) println(" memory before: " + (runtime.freeMemory/1048576.).formatted("%10.2f") + " MB") + if (debug) println(" memory before: " + freeMemoryString) val comp = new Compiler(classpath, settings) container += Pair(id, comp) - if (debug) println(" memory after: " + (runtime.freeMemory/1048576.).formatted("%10.2f") + " MB") + if (debug) println(" memory after: " + freeMemoryString) comp } def break(id: String): Null = { - val runtime = Runtime.getRuntime if (debug) println("Breaking compiler " + id) - if (debug) println(" memory before: " + (runtime.freeMemory/1048576.).formatted("%10.2f") + " MB") + if (debug) println(" memory before: " + freeMemoryString) container -= id - System.gc - if (debug) println(" memory after: " + (runtime.freeMemory/1048576.).formatted("%10.2f") + " MB") + System.gc() + if (debug) println(" memory after: " + freeMemoryString) null } + + private def freeMemoryString: String = + (Runtime.getRuntime.freeMemory/1048576.0).formatted("%10.2f") + " MB" } |