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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Mar 29 20:43:45 UTC 2021


On Mon, 29 Mar 2021 18:47:21 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> Summarizing so i have the correct understanding.
> 
> The core fix is to update `LibraryLookupImpl` to hold a memory segment that is sliced to the address of symbols, thereby keeping a ref-chain for returned segments **and** addresses of symbols.
> 
> Separately, the `Symbol` abstraction is not worth it, and we can lean on returning `MemorySegment` for a symbol covering some region of memory (like some constant).

Exactly. The only value added of Symbol was "the name getter" - but honestly that doesn't strike me as something super useful (given that you have to specify a name to the API in the first place).

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

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


More information about the panama-dev mailing list