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

Albert Mingkun Yang ayang at openjdk.org
Wed Jul 10 20:36:26 UTC 2024


On Wed, 10 Jul 2024 15:54:07 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> A Generation class that doesn't have an allocation API seems really strange to me.

`Generation class` is kind of private. Only subclasses are directly used. The long term plan is to move all virtual methods from parent class to subclasses so that the inheritance hierarchy is only for coding sharing but not polymorphism, which incurs unnecessary complexity here.

> And I disagree about the function names being sufficient to eliminate the comments.

I can add some in the subclasses.

> Interfaces can be a good thing, if they are well designed.

`Generation` is never treated as an interface in current code base though.

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

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


More information about the hotspot-gc-dev mailing list