On Fri, 19 May 2023 11:08:10 GMT, Maurizio Cimadamore <[email protected]>
wrote:
>> This patch adds an instance method on `Linker`, namely
>> `Linker::canonicalLayouts` which returns all the layouts known by the linker
>> as implementing some ABI type. For instance, if I call this on my machine
>> (Linux/x64) I get this:
>>
>>
>> jshell> import java.lang.foreign.*;
>>
>> jshell> Linker.nativeLinker().canonicalLayouts()
>> $2 ==> {char16_t=c16, int8_t=b8, long=j64, size_t=j64, bool=z8, int=i32,
>> long long=j64, int64_t=j64, void*=a64, float=f32, char=b8, int16_t=s16,
>> int32_t=i32, short=s16, double=d64}
>>
>>
>> This can be useful to discover the ABI types supported by a linker
>> implementation, as well as for, in the future, add support for more exotic
>> (and platform-dependent) linker types, such as `long double` or `complex
>> long`.
>
> Maurizio Cimadamore has updated the pull request incrementally with two
> additional commits since the last revision:
>
> - Address review comments
> - More javadoc tweaks
src/java.base/share/classes/java/lang/foreign/Linker.java line 62:
> 60: * </ul>
> 61: * A linker provides a way to lookup up the <em>canonical layouts</em>
> associated with the data types used by the ABI.
> 62: * For example, the canonical layout for the C {@code size_t} type is
> equal to {@link ValueLayout#JAVA_LONG}. The canonical
Suggestion:
* For example, the canonical layout for the C {@code size_t} type is equal to
{@link ValueLayout#JAVA_LONG} on 64-bit platforms. The canonical
?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14037#discussion_r1199471895