Part 1 Proposal for JDK-8264594
leerho
leerho at gmail.com
Thu Jun 10 17:35:55 UTC 2021
I am wondering what would be easiest for you: to submit code via email as
I have been doing, or create a branch in my public GitHub account with the
changes: https://github.com/leerho/panama-foreign.
Lee.
On Thu, Jun 10, 2021 at 10:28 AM Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:
>
> On 10/06/2021 18:12, leerho wrote:
>
> Maurizio,
> Now that you have submitted the draft PR (
> https://github.com/openjdk/panama-foreign/pull/555
> <https://urldefense.com/v3/__https://github.com/openjdk/panama-foreign/pull/555__;!!GqivPVa7Brio!L7IEC9nvw3-eZ1gbja21ZH_OuKDyt966kthXXAAUmcUYVu7n7B2GF_I7ib7MzKhlIjvboLw$>),
> 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?
>
> You can go ahead and work on the changes. I will update the PR accordingly.
>
>
> 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
> ).
>
> Ok
>
>
> I will have to relay these changes through you as I don't have permission
> to submit changes directly.
>
> That's absolutely fine, no worries - as long as everything is visible on
> this list :-)
>
> Thanks
> Maurizio
>
>
> 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