Given a src array, an offset, and a len, return a new array which copies the relevant area of src.
Given a src array, an offset, and a len, return a new array which copies the relevant area of src.
This method does not do any size or bounds checking.
Efficient alternative to Array.apply.
Efficient alternative to Array.apply.
"As seen on scala-internals!"
NOTE: As of Scala 2.12 this seems unnecessary: Array(...) now uses a similar technique to produce efficient code.
Takes in something like: ArrayUtil.alloc[Int](11, 22, 33, 44)(ct)
Takes in something like: ArrayUtil.alloc[Int](11, 22, 33, 44)(ct)
and builds a tree like: { val arr:Array[Int] = ct.newArray(4) arr.update(0, 11) arr.update(1, 22) arr.update(2, 33) arr.update(3, 44) arr }
Given a number n, this method returns n if n is a power-of-two.
Given a number n, this method returns n if n is a power-of-two.
Otherwise, it returns the smallest power-of-two larger than n.