[foreign-jextract] Integrated: 8253290: Tweak jextract code to use new MemoryAddress::asSegmentRestricted
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Thu Sep 17 14:03:43 UTC 2020
On Thu, 17 Sep 2020 13:50:03 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This fixes references to the now-removed MemorySegment::ofNativeRestricted(...).
>
> The only tricky issue is in RunimeHelper - which has to create an unchecked segment for a global variable and,
> in doing so, it has to keep a reference of the lookup symbol in there, to prevent the library from being unloaded.
>
> Since the new API doesn't have an explicit way to add an attachment, I've added a simple Runnable impl which wraps a
> symbol, and pass that as a no-op cleanup action to the segment.
>
> For the records, I believe that creating segments for global vars is tricky enough that there should be a blessed
> (restricted) way to do that in the LibraryLookup.Symbol API.
This pull request has now been integrated.
Changeset: ed844b64
Author: Maurizio Cimadamore <mcimadamore at openjdk.org>
URL: https://git.openjdk.java.net/panama-foreign/commit/ed844b64
Stats: 41 lines in 3 files changed: 2 ins; 29 del; 10 mod
8253290: Tweak jextract code to use new MemoryAddress::asSegmentRestricted
Reviewed-by: sundar
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/335
More information about the panama-dev
mailing list