[vector] Add non-masked Vector. intoByteArray accepting a byte order
Paul Sandoz
paul.sandoz at oracle.com
Wed May 6 23:13:52 UTC 2020
Here’s an update:
http://cr.openjdk.java.net/~psandoz/panama/vector-intoByteArray-with-byte-order/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/vector-intoByteArray-with-byte-order/webrev/>
Paul.
> On May 6, 2020, at 10:25 AM, John Rose <john.r.rose at oracle.com> wrote:
>
> On May 6, 2020, at 8:11 AM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>>
>> Perhaps rather than filling out we need to slim down. where ByteOrder is a required parameter, then that fits with the pattern of non-mask and mask variants of many other methods:
>>
>> public abstract void intoByteArray(byte[] a, int offset, ByteOrder bo);
>> public abstract void intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<E> m);
>>
>> And, we do the same for [EType]Vector.fromByteArray.
>
> That’s not terrible. After all, if you are working with byte arrays,
> you really do need to pay attention to byte order; it doesn’t just
> sweep itself under the rug and go away. (Trying to pretend byte
> order doesn’t exist leads to a special code smell I call byte odor.)
>
> — John
More information about the panama-dev
mailing list