On Fri, 16 Oct 2026 10:40:22 GMT, Jorn Vernee <[email protected]> wrote:

> Currently the javadoc of Linker has many examples that use the `JAVA_*` 
> layout constants.
> 
> It is preferred for users to use the canonical layouts the linker returns, 
> since they have a much more obvious mapping to native types, and are 
> guaranteed to work.
> 
> This patch tweaks the examples to be written in terms of canonical layouts 
> rather than the `JAVA_*` constants. It adds a missing column to the table of 
> example types that lists their canonical layout name (which doesn't match the 
> C type name for `void*`).
> 
> Since this is a doc clarification, no CSR is needed.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/java/lang/foreign/Linker.java line 96:

> 94:  * Note how the native linker also provides access, via its {@linkplain 
> #defaultLookup() default lookup},
> 95:  * to the native functions defined by the C libraries loaded with the 
> Java runtime.
> 96:  * Above, the default lookup is used to search for the address of the 
> {@code strlen} native

Small typo I noticed while reading.

src/java.base/share/classes/java/lang/foreign/Linker.java line 896:

> 894:          * {@return a struct layout that represents the layout of the 
> capture state
> 895:          *         segment that is passed to a downcall handle linked 
> with
> 896:          *         {@link #captureCallState(String...)}}

Noticed some weird formatting here that I fixed as well.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33411#discussion_r4293740488
PR Review Comment: https://git.openjdk.org/jdk/pull/33411#discussion_r4293749129

Reply via email to