RFR: 8308293: A linker should expose the layouts it supports [v5]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed May 24 09:22:08 UTC 2023
> 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 one additional commit since the last revision:
Drop "unsigned short"
Beef up javadoc
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14037/files
- new: https://git.openjdk.org/jdk/pull/14037/files/dbc8049a..708f987d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14037&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14037&range=03-04
Stats: 35 lines in 5 files changed: 6 ins; 13 del; 16 mod
Patch: https://git.openjdk.org/jdk/pull/14037.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14037/head:pull/14037
PR: https://git.openjdk.org/jdk/pull/14037
More information about the core-libs-dev
mailing list