RFR: 8267752: KVHashtable doesn't deallocate entries
Ioi Lam
iklam at openjdk.java.net
Wed Jun 16 01:25:34 UTC 2021
On Tue, 15 Jun 2021 22:34:40 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> Add a free_entry iteration to the destructor of ~KVHashtables.
> Tested with tier1-3.
Changes requested by iklam (Reviewer).
src/hotspot/share/utilities/hashtable.hpp line 268:
> 266: for (KVHashtableEntry** p = bucket_addr(index); *p != NULL; ) {
> 267: probe = *p;
> 268: *p = probe->next();
Should we also call the destructor (something like `probe->_value.~V()` , not sure about the syntax). I.e., similar to `GrowableArray<E>`:
https://github.com/openjdk/jdk/blob/e0f6f70d3f9e748d2bc53f371beca487e9343d4a/src/hotspot/share/utilities/growableArray.hpp#L499-L501
This way, we can get rid of this code, and move `delete ref()` into `SourceObjInfo::~SourceObjInfo()`
https://github.com/openjdk/jdk/blob/e0f6f70d3f9e748d2bc53f371beca487e9343d4a/src/hotspot/share/cds/archiveBuilder.hpp#L180-L186
-------------
PR: https://git.openjdk.java.net/jdk/pull/4501
More information about the hotspot-dev
mailing list