[foreign-memaccess+abi] RFR: 8264386: LibraryLookup should be more friendly with implicit unloading [v2]

Jorn Vernee jvernee at openjdk.java.net
Mon Mar 29 22:32:53 UTC 2021


On Mon, 29 Mar 2021 20:40:10 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/LibrariesHelper.java line 131:
>> 
>>> 129:         @CallerSensitive
>>> 130:         public Optional<MemorySegment> lookup(String name, MemoryLayout layout) {
>>> 131:             Reflection.ensureNativeAccess(Reflection.getCallerClass());
>> 
>> Should this method and the other overload have the `@NativeAccess` annotation?
>
> @NativeAccess is for API only (e.g. think javadoc). So the annotations go in `LibraryLookup`

Ah ok, I forgot about the difference.

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

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


More information about the panama-dev mailing list