Part 1 Proposal for JDK-8264594
leerho
leerho at gmail.com
Thu Jun 10 16:33:27 UTC 2021
Also, to make the comparison more fair, we should add the user ability to
compute the logical offset for option 1.
Restating the options:
1. copyIntoArrayRaw(segment, srcOffsetBytes, long[] dstArray,
dstIndexLongs, dstCopyLengthLongs)
//For the "Logical" case, user has the option to write:
copyIntoArrayRaw(segment, srcOffsetLongs * 8L, long[] dstArray,
dstIndexLongs, dstCopyLengthLongs)
2. copyIntoArrayRaw(segment, srcOffsetBytes, long[] dstArray,
dstIndexLongs, dstCopyLengthLongs)
And
copyIntoArrayLogical(segment, srcOffsetLongs, long[] dstArray,
dstIndexLongs, dstCopyLengthLongs)
3. copyIntoArrayLogical(segment, srcOffsetLongs, long[] dstArray,
dstIndexLongs, dstCopyLengthLongs)
//For the "Raw" case, user has the option to write a compound statement
like:
copyIntoArrayLogical(segment.asSlice(srcOffsetBytes), 0, long[]
dstArray, dstIndexLongs, dstCopyLengthLongs)
Lee.
On Thu, Jun 10, 2021 at 1:45 AM Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:
>
> On 10/06/2021 00:02, leerho wrote:
> > // I think we discussed a while back that the asSlice would also
> > require a length.
>
> Minor correction - with the new API, I don't think you need a length.
>
> There is an overload of asSlice which just takes an offset, and
> recomputes the length automatically.
>
> So, if you use that, combined with the static method you provide, I
> think we should be good?
>
> copyIntoArrayLogical(segment.asSlice(srcOffsetBytes), 0, long[]
> dstArray, dstIndexLongs, dstCopyLengthLongs)
>
> Maurizio
>
>
More information about the panama-dev
mailing list