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
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
- csr for
-
JDK-8320409 Deprecate `RegisterFinalizersAtInit` option and code
-
- Closed
-
- relates to
-
JDK-8320522 Remove code related to `RegisterFinalizersAtInit`
-
- Resolved
-