RFR: 8340205: Native linker allows MemoryLayout consisting of only PaddingLayout [v3]
Jorn Vernee
jvernee at openjdk.org
Mon Sep 23 12:19:40 UTC 2024
On Mon, 23 Sep 2024 11:15:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Previously, the check threw an `IllegalArgumentException` when presented with the above (or other) group layout with only padding layouts, but the actual message differed. So, this change only changes the exception message and does not change the current behavior. However, the question remains: Should we update the docs to reflect this behavior?
>
> Note: I know the behavior in this particular case is not affected by the PR. That said, since you already need CSR for the "sequence with padding" behavioral change, I think it could make sense to piggy back on this PR, and clarify the javadoc for the other case as well.
> We have a padding of 1, which makes the group have size 1, which is a multiple of the alignment of the struct. So, ok?
This is a good example. This seems to satisfy the rules, but is rejected at the moment. I agree, we probably need to mention that structs with _just_ padding (or sequences thereof) are not allowed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21041#discussion_r1771295525
More information about the core-libs-dev
mailing list