RFR: 8308293: A linker should expose the layouts it supports [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed May 17 22:37:50 UTC 2023
On Wed, 17 May 2023 22:08:57 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Tweak javadoc
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14037#discussion_r1197121074
More information about the core-libs-dev
mailing list