RFR: 8268078: ClassListParser::_interfaces should be freed

Ioi Lam iklam at openjdk.java.net
Tue Jun 15 22:28:36 UTC 2021


On Tue, 15 Jun 2021 20:29:12 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> This patch frees the `_interfaces`, `_indy_items`, and `_id2klass_table` of `ClassListParser` in its destructor.
> It also fixes the non-NULL check at line 88.
> 
> - [x] mach5 tiers 1, 2 tests

Changes requested by iklam (Reviewer).

src/hotspot/share/cds/classListParser.cpp line 94:

> 92:   delete _indy_items;
> 93:   delete _interfaces;
> 94:   cleanup_table();

I just realized that the `_id2klass_table` contains only `InstanceKlass*` values, so there's no need to clean up the values themselves (the InstanceKlass should keep on living after the table is deallocated).

It's the entries of `_id2klass_table` that need to be freed, but that should be done separately. See [JDK-8267752](https://bugs.openjdk.java.net/browse/JDK-8267752)

So I think the changes related to `_id2klass_table` in this PR are no longer needed. Sorry for pointing you to the wrong direction. The rest looks OK to me.

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

PR: https://git.openjdk.java.net/jdk/pull/4498


More information about the hotspot-runtime-dev mailing list