Auxiliary libraries for Scala Native runtime providing essential runtime support including boxed types, concurrent collections, and utility functions
—
Array cloning utilities supporting all primitive array types and object arrays with proper type preservation. The ArrayRuntime object provides essential array operations for the Scala Native runtime system.
import scala.runtime.ArrayRuntimeCreates shallow copies of arrays for all primitive types and object arrays.
object ArrayRuntime {
def cloneArray(array: Array[Boolean]): Array[Boolean]
def cloneArray(array: Array[Byte]): Array[Byte]
def cloneArray(array: Array[Short]): Array[Short]
def cloneArray(array: Array[Char]): Array[Char]
def cloneArray(array: Array[Int]): Array[Int]
def cloneArray(array: Array[Long]): Array[Long]
def cloneArray(array: Array[Float]): Array[Float]
def cloneArray(array: Array[Double]): Array[Double]
def cloneArray(array: Array[java.lang.Object]): Array[java.lang.Object]
}import scala.runtime.ArrayRuntime
// Clone primitive arrays
val intArray = Array(1, 2, 3, 4, 5)
val clonedIntArray = ArrayRuntime.cloneArray(intArray)
val doubleArray = Array(1.0, 2.0, 3.0)
val clonedDoubleArray = ArrayRuntime.cloneArray(doubleArray)
// Clone object arrays
val stringArray = Array("hello", "world")
val clonedStringArray = ArrayRuntime.cloneArray(stringArray.asInstanceOf[Array[java.lang.Object]])
// The cloned arrays are independent
clonedIntArray(0) = 100
println(intArray(0)) // 1 (original unchanged)
println(clonedIntArray(0)) // 100 (clone modified)cloneArray methods perform shallow copyingInstall with Tessl CLI
npx tessl i tessl/maven-org-scala-native--auxlib-native0-5-3