Part 1 Proposal for JDK-8264594

leerho leerho at gmail.com
Thu Jun 10 17:12:57 UTC 2021


Maurizio,
Now that you have submitted the draft PR (
https://github.com/openjdk/panama-foreign/pull/555), should I make the
changes necessary to the MemoryCopy class to call the
*MemorySegment.copyFrom(MemorySegment
src, ValueLayout srcElementLayout,*
*ValueLayout dstElementLayout)* implemented in the PR?   -- Or should I
wait until it is at least in a branch?

Also, as I mentioned earlier, the TestMemoryCopy will have to be rewritten
to also test the byte swaps.  (and fix some of the extra space errors found
).

I will have to relay these changes through you as I don't have permission
to submit changes directly.

Lee.



On Thu, Jun 10, 2021 at 9:33 AM leerho <leerho at gmail.com> wrote:

> 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