RFR: 8335925: Serial: Move allocation API from Generation to subclasses

Kim Barrett kbarrett at openjdk.org
Wed Jul 10 20:07:36 UTC 2024


On Mon, 8 Jul 2024 20:00:31 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Trivial moving methods from parent class to subclasses. The unused second arg is also removed along the way. The API names are descriptive enough so that the accompanying comments are dropped as well.

A Generation class that doesn't have an allocation API seems really strange to
me. And I disagree about the function names being sufficient to eliminate the
comments.

If all callers are applying the allocation functions to a known derived
object, then any virtual overhead can be eliminated via "final" qualifiers.
Interfaces can be a good thing, if they are well designed. Without that
framework I would expect the different subclasses to (perhaps unintentionally)
diverge over time. I would only think this change was appropriate if some
useful point of divergence has already been identified.

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

PR Comment: https://git.openjdk.org/jdk/pull/20084#issuecomment-2220898167


More information about the hotspot-gc-dev mailing list