diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-10-21 13:19:33 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-10-21 13:19:33 +0000 |
commit | 70bc8f93c56d6ac2390bbae8a0ab173926240549 (patch) | |
tree | c6b3fef1fa2b95607732b28187be3cd89654e025 /src/library/scala/compat | |
parent | 58651079b710013873372f12a451146b640581c7 (diff) | |
download | scala-70bc8f93c56d6ac2390bbae8a0ab173926240549.tar.gz scala-70bc8f93c56d6ac2390bbae8a0ab173926240549.tar.bz2 scala-70bc8f93c56d6ac2390bbae8a0ab173926240549.zip |
Made Platform methods inlineable and allow the ...
Made Platform methods inlineable and allow the optimiser to load code
for methods that have the @inline attribute
Diffstat (limited to 'src/library/scala/compat')
-rw-r--r-- | src/library/scala/compat/Platform.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala index 8c1d84771a..9bbfba25bc 100644 --- a/src/library/scala/compat/Platform.scala +++ b/src/library/scala/compat/Platform.scala @@ -26,6 +26,7 @@ object Platform { * @param destPos .. * @param length .. */ + @inline def arraycopy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int) { System.arraycopy(src, srcPos, dest, destPos, length) } @@ -37,19 +38,25 @@ object Platform { * @param length .. * @return .. */ + @inline def createArray(elemClass: Class[_], length: Int): AnyRef = java.lang.reflect.Array.newInstance(elemClass, length) + @inline def arrayclear(arr: Array[Int]) { java.util.Arrays.fill(arr, 0) } + @inline def getClassForName(name: String): Class[_] = java.lang.Class.forName(name) val EOL = System.getProperty("line.separator", "\n") + @inline def currentTime: Long = System.currentTimeMillis() + @inline def collectGarbage: Unit = System.gc() /** The name of the default character set encoding as a string */ + @inline def defaultCharsetName: String = java.nio.charset.Charset.defaultCharset.name } |