Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-05 Thread Maurizio Cimadamore
On Thu, 5 May 2022 16:39:08 GMT, Mandy Chung wrote: >> `BootLoader` is what you want in this case - it defines the static methods >> to access resources, packages etc defined to the boot loader (aka null >> `ClassLoader`). >> >> To find a symbol defined in the native libraries loaded by the bo

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-05 Thread Mandy Chung
On Thu, 5 May 2022 16:22:41 GMT, Mandy Chung wrote: >> Looking deeper, `System::loadLibrary` seems to search the boot loader >> libraries when invoked with a `null` caller class, so replicating that >> behavior should be safe. > > `BootLoader` is what you want in this case - it defines the stat

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-05 Thread Mandy Chung
On Wed, 4 May 2022 23:44:08 GMT, Maurizio Cimadamore wrote: >> Another option would be to treat calls to `ensureNativeAccess` with `null` >> caller class as coming from unnamed module. > > Looking deeper, `System::loadLibrary` seems to search the boot loader > libraries when invoked with a `nu

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-04 Thread Maurizio Cimadamore
On Wed, 4 May 2022 23:29:53 GMT, Maurizio Cimadamore wrote: >> Good points. Regarding `ClassLoader` being null, I think we can still return >> something using the `BootLoader`'s `NativeLibraries` object - that would >> allow this method to be called internally. @mlchung Can you please confirm?

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-04 Thread Maurizio Cimadamore
On Wed, 4 May 2022 23:20:21 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/foreign/SymbolLookup.java line 153: >> >>> 151: static SymbolLookup loaderLookup() { >>> 152: Class caller = Reflection.getCallerClass(); >>> 153: ClassLoader loader = >>> O

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-04 Thread Maurizio Cimadamore
On Wed, 4 May 2022 16:47:28 GMT, ExE Boss wrote: >> Maurizio Cimadamore has updated the pull request with a new target base due >> to a merge or a rebase. The pull request now contains 57 commits: >> >> - Merge branch 'master' into foreign-preview >> - Update >> src/java.base/share/classes/j

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-04 Thread ExE Boss
On Tue, 3 May 2022 10:40:02 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-424 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjdk

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v37]

2022-05-03 Thread Maurizio Cimadamore
> This PR contains the API and implementation changes for JEP-424 [1]. A more > detailed description of such changes, to avoid repetitions during the review > process, is included as a separate comment. > > [1] - https://openjdk.java.net/jeps/424 Maurizio Cimadamore has updated the pull request