RFR: 8344332: (bf) Migrate DirectByteBuffer to use java.lang.ref.Cleaner [v11]

Alan Bateman alanb at openjdk.org
Thu Jan 30 16:57:00 UTC 2025


On Thu, 30 Jan 2025 08:36:34 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/java.base/share/classes/java/nio/Bits.java line 146:
>> 
>>> 144:                 }
>>> 145: 
>>> 146:                 if (canary == null || canary.isDead()) {
>> 
>> If we're keeping Reference.waitForPendingReferences, why not continue to use it, rather than introducing
>> the canary as a new, ad hoc, reference processing progress detector?
>
> @kimbarrett Do you have a change coming to allow waitForPendingReferences be used by WB? I assume this will at least add a comment to the method (or whatever it changes to) to make it clear that it's for testing.

> @AlanBateman I've not done any work on JDK-8305186. There has also been discussion about making that function non-private or even public (though with concerns about specification difficulty) for use in places like this.

Exposing this in this API might be scary, I think would need a lot of thinking to be confident it doesn't create an attractive nuisance. Keeping it for WB testing is okay of course.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22165#discussion_r1935953253


More information about the core-libs-dev mailing list