On Thu, 18 Nov 2021 07:52:18 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Yeah, "flag" is `Holder.ENABLED` here. I mean, are Java methods >> `registerFinalizer` and `runFinalization` called only by VM? If so, can VM >> check the whole thing on VM side, without going to Java and asking back from >> there? > > `registerFinalizer` does not expect to be called and only uses the "flag" as > a form of assertion. > > `runFinalization` is called from Java code. @dholmes-ora If the Finalizer class is initialized explicitly and at the right time, then maybe we can do away with the Holder class entirely. Can you point me to where this is done? ------------- PR: https://git.openjdk.java.net/jdk/pull/6442