Package org.jruby.util
Class ArraySupport
java.lang.Object
org.jruby.util.ArraySupport
Support methods for (native) arrays.
These utility methods are intended as `System.arraycopy` replacements esp. for common cases
such as (method) argument processing, where the arrays are usually small. These are fairly
common and for such arrays a length switch + an "inlined" array copy/instantiation cuts the
execution time to (at least) half, compared to doing a bare native `arraycopy` (on 8u102).
- Author:
- kares
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
Copy a source array into a destination array.static Class[]
static Object[]
static Object[]
static IRubyObject[]
newCopy
(IRubyObject[] src, int length) static IRubyObject[]
newCopy
(IRubyObject[] src, int srcOff, int length) static IRubyObject[]
newCopy
(IRubyObject[] src, IRubyObject last) static IRubyObject[]
newCopy
(IRubyObject first, IRubyObject[] src)
-
Method Details
-
copy
Copy a source array into a destination array.- Parameters:
src
-dst
-dstOff
- off set to start copying tolength
- copied array length
-
copy
-
newCopy
-
newCopy
-
newCopy
-
newCopy
-
newCopy
-
newCopy
-
newCopy
-