RFR: 8308293: A linker should expose the layouts it supports [v2]

Paul Sandoz psandoz at openjdk.org
Wed May 17 22:48:52 UTC 2023


On Wed, 17 May 2023 22:34:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/foreign/Linker.java line 219:
>> 
>>> 217:  * <ol>
>>> 218:  * <li>the alignment constraint of {@code G} is set to its <a href="MemoryLayout.html#layout-align">natural alignment</a>;</li>
>>> 219:  * <li>the size of {@code G} is a multiple of its alignment constraint;</li>
>> 
>> Do you think this is a constraint that will hold across all linker implementations?
>
> All "native linkers" as the text says. Other linkers (e.g. not for C) might obey other rules. These rules are basically constraining  struct layouts to what can come out of a native compiler in the absence of pragma pack directives.

Ah, i see now, i missed the relevance of that term, introduced earlier in non-modified text.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14037#discussion_r1197130720


More information about the core-libs-dev mailing list