[foreign-memaccess] [Rev 01] RFR: JDK-8242011: Add support for memory address combinator
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Thu Apr 2 14:38:51 UTC 2020
On Thu, 2 Apr 2020 10:41:41 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java line 262:
>>
>>> 261: public static VarHandle withStride(VarHandle target, long bytesStride) {
>>> 262: if (bytesStride == 0) {
>>> 263: throw new IllegalArgumentException("Stride must be positive: " + bytesStride);
>>
>> Pre-existing, but it seems that this should check for `byteStride <= 0` instead?
>
> also good point, will fix and add a test
After offline discussion I've removed these restrictions. Now all offset and stride values are legal - but if you use 0
some very minimal adaptation (or none at all) will take place. "Be liberal in what you accept".
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/84
More information about the panama-dev
mailing list