Support request about FFM Panama Implementation

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Feb 5 21:37:50 UTC 2025


This is interesting. Yes, dlmopen seems to support loading "in a 
namespace" which might achieve what you need.

If that's the case (I suggest perhaps you do some experiments with C 
first), then it should be doable for you to create your own SymbolLookup 
that is based on dlmopen (you can call dlmopen using a downcall method 
handle, and get the library handle that way, then pass the library 
handle to "dlsym" to do the lookup).

You can find an implementation of a dlopen-based lookup done using 
jextract here:

https://github.com/openjdk/jextract/blob/master/samples/dlopen/Dlopen.java

It should be relatively simple (I hope) to take that code and tweak it 
so that it works on dlmopen.

Maurizio



On 05/02/2025 17:20, roberto.minoletti at trusthub.cloud wrote:
> https://docs.oracle.com/cd/E88353_01/html/E37843/dlmopen-3c.html
>
> Anyway it seems that Panama can not directly handle dlmopen so the idea
> is to relay to JNA to connect to dlmopen first and then use Panama for a
>   better memory management and performance.
>
> What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20250205/608f143c/attachment.htm>


More information about the panama-dev mailing list