RFR: 8269004 Implement ResizableResourceHashtable [v4]

Kim Barrett kbarrett at openjdk.java.net
Fri Jul 2 07:49:05 UTC 2021


On Fri, 2 Jul 2021 06:03:29 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/utilities/resourceHash.hpp line 80:
>> 
>>> 78: 
>>> 79:   Node const** lookup_node(unsigned hash, K const& key) const {
>>> 80:     return const_cast<Node const**>(
>> 
>> [pre-existing] I think this `const_cast` to add const is unnecessary.
>
> I tried removing it but gcc complains. I will leave it as is for now.

Oops, I misread it.  OK.

>> src/hotspot/share/utilities/resourceHash.hpp line 224:
>> 
>>> 222:     memset(_table, 0, TABLE_SIZE * sizeof(Node*));
>>> 223:   }
>>> 224: 
>> 
>> Destructor should be non-public to prevent slicing.  Also need to consider what to do about copying.
>
> This class doesn't have a destructor. Should I add one and make it protected?

I would.  Make it `= default`.

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

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


More information about the hotspot-dev mailing list