[foreign-memaccess+abi] RFR: 8278151: Heap segments should handle alignment constraints in a deterministic fashion [v4]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Dec 3 13:26:42 UTC 2021


On Thu, 2 Dec 2021 17:52:50 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Strengthen test
>
> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java line 265:
> 
>> 263:      * {@code elementLayout} size is greater than zero, if this segment is
>> 264:      * <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraints</a> in the provided layout,
>> 265:      * or if the {@code elementLayout} alignment is greater than its size.
> 
> I believe its possible to have multiple declarations of `@throws IllegalArgumentException`, so if you wish for clarity there could be a declaration for each separate case.

This is a good suggestion, but I'd prefer to handle it separately, as there are also other places where this can come in handy.

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/622


More information about the panama-dev mailing list