[foreign-jextract] RFR: 8253307: Simplify code in RuntimeHelper::lookupGlobalVariable
Henry Jen
henryjen at openjdk.java.net
Thu Sep 17 21:32:09 UTC 2020
On Thu, 17 Sep 2020 20:37:07 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> Earlier today, I added a workaround on RuntimeHelper when I tweaked it to use the new
> MemoryAddress::asSegmentRestricted API. The old code was adding the lookup symbol as an attachment to the returned
> segment, so I did a workaround to do just that under the new API.
> Turns out that the workaround wasn't needed (I think). Upon more thinking, I realized that we always store an array of
> LibraryLookup inside the very constant holder class - either as a static field, or as a dynamically loaded constant.
> I think in both cases that should be enough to prevent the lookup object from going unreachable.
LGTM!
-------------
Marked as reviewed by henryjen (Committer).
PR: https://git.openjdk.java.net/panama-foreign/pull/339
More information about the panama-dev
mailing list