Deprecate `RegisterFinalizersAtInit` option and code

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 22
    • Component/s: hotspot
    • b26

      The `RegisterFinalizersAtInit` option controls whether finalizers are registered after allocation or at return from the Object.<init> constructor. The default is to register at the end of Object.<init> and this has been the default for years.

      We should remove the option and hardcode it always be true so finalizers can only be registered at the end of Object.<init>.

      Continuing to support the flag is counter to the increased Integrity push [0] and will be increasingly problematic when Project Valhalla merges in due to allowing larval objects to escape before they are frozen.


      [0] https://openjdk.org/jeps/8305968

            Assignee:
            Dan Heidinga
            Reporter:
            Dan Heidinga
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: