[foreign-abi] RFR: 8253430: Improve the LibraryLookup API [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Sep 21 17:07:05 UTC 2020


On Mon, 21 Sep 2020 16:24:10 GMT, Ty Young <github.com+10172435+BlueGoliath at openjdk.org> wrote:

> Path.of(System.getenv("WINDIR"), "/system32/nvml.dll")
> 
> vs.
> 
> Path.of("/usr/lib/", "libnvidia-ml.so")

I think using a varargs of library names does not adhere with my (obviously subjective) API bar.

If you have a library that has name X in one system and name Y in a different system, it seems to me that you should
have a constant that is initialized with the right name depending on the system and then load that. Passing a list of
all possible alternatives, while doable, seems an odd way to get there.

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

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


More information about the panama-dev mailing list