[foreign-memaccess+abi] RFR: 8265222: revisit foreign library loading [v2]

Athijegannathan Sundararajan sundar at openjdk.java.net
Thu May 6 14:26:49 UTC 2021


On Thu, 6 May 2021 13:29:20 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Windows hack for malloc/free. fixed javadoc comments. benchmarks use new APIs. removed psapi.h header include.
>
> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 134:
> 
>> 132: 
>> 133:     /**
>> 134:      * Looks up a symbol with the given name in the native libraries loaded by the caller's classloader.
> 
> Suggestion:
> 
>      * Finds the address of a symbol with given name in one of the native libraries associated with the caller's classloader (that is, libraries loaded using {@link System#loadLibrary} or {@link System#load}).

will change

> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java line 120:
> 
>> 118:  * }</pre>
>> 119:  *
>> 120:  * Here, we lookup the {@code strlen} symbol. C runtime library should have been loaded earlier using {@link System#loadLibrary(String)}.
> 
> Suggestion:
> 
>  * Here, we lookup the {@code strlen} symbol; this assumes that a library containing the `strlen` symbol has been loaded earlier, e.g. using {@link System#loadLibrary(String)}.

will fix

> src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java line 419:
> 
>> 417: 
>> 418:         private static final CLinker linker = getSystemLinker();
>> 419:         // FIXME: This should go away. This is temporary hack to get testing on Windows going.
> 
> Move the fixme closer to the hack, right before the `if` in the static block

will do

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

PR: https://git.openjdk.java.net/panama-foreign/pull/526


More information about the panama-dev mailing list