RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v15]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Mar 29 23:58:24 UTC 2023


On Wed, 29 Mar 2023 22:32:20 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> I've updated the specs as per how I interpret the comments above. Let me know your thoughts on this.
>
> This is much clearer. Are the names of the struct members guaranteed to be symbols that can be found up via the linker's default lookup? i.e. a small set of important global variables.

While they might be defined as global variable, I wouldn't read too much into this. Even `errno` is not really a global variable, but some thread local value that the native compiler knows about (e.g. setting the global variable doesn't really do much). Quoting from Linux man page:


errno  is  defined  by  the ISO C standard to be a modifiable lvalue of
       type int, and must not be explicitly declared; errno may  be  a  macro.
       errno  is  thread-local;  setting  it in one thread does not affect its
       value in any other thread.


This seems to imply that errno might even be something else. Given how the story goes for errno, I don't think we'd want to restrict the spec to state that these names should be discoverable via the lookup.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13079#discussion_r1152598834



More information about the build-dev mailing list