RFR: 8367401: Parallel: Remove unused field in PSKeepAliveClosure
Stefan Karlsson
stefank at openjdk.org
Thu Sep 11 12:36:38 UTC 2025
On Thu, 11 Sep 2025 09:24:05 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> > Looks good. I wouldn't mind if you also removed the:
> > ```
> > assert(_promotion_manager != nullptr, "Sanity");
> > ```
>
> It's to ensure the passed-in arg is not null. There is only one caller, which does provide a valid arg, but for catching misuse more promptly, I'd keep it.
Yes, that's obvious. You would crash immediately during development if you ever try to pass in a null object here. And the same goes for thousands of other places in the GC that don't null check the arguments. So, having this one-of null check seems a bit silly to me.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27210#issuecomment-3280403461
More information about the hotspot-gc-dev
mailing list