RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

Kim Barrett kbarrett at openjdk.org
Tue Sep 10 05:05:09 UTC 2024


On Mon, 9 Sep 2024 16:25:15 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> @dholmes-ora Is this really possible? The `obj` ref is passed to the PhantomReference constructor, which stores it in a field, the constructed PhantomReference is returned, and it's then used in a reachabilityFence call below. So `obj` should remain reachable the entire time, right?
>
> (As an aside, I wasn't able to determine what any of the Reference classes do if they're created with a null reference. Possibly a spec bug?)

I also agree with @stuart-marks that the moved to near the ned RF for `ref` is sufficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20898#discussion_r1751251574


More information about the core-libs-dev mailing list