[jdk17u-dev] RFR: 8271506: Add ResourceHashtable support for deleting selected entries
Thomas Stuefe
stuefe at openjdk.java.net
Mon Jan 31 13:07:22 UTC 2022
On Mon, 31 Jan 2022 08:38:32 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:
> I backport this as prerequisite to JDK-8274944 which calls the new method unlink().
>
> I had to adapt the code to work in jdk17 because ""JDK-8269004: Implement ResizableResourceHashtable" is missing in 17.
Changes requested by stuefe (Reviewer).
src/hotspot/share/utilities/resourceHash.hpp line 203:
> 201: // the entry is deleted.
> 202: template<class ITER>
> 203: void unlink(ITER* iter) const {
Seems very weird to have this as a const method. It clearly modifies the table. Mainline version is not const, why here?
src/hotspot/share/utilities/resourceHash.hpp line 205:
> 203: void unlink(ITER* iter) const {
> 204: Node** bucket = const_cast<Node**>(_table);
> 205: while (bucket < &_table[SIZE]) {
This is an odd way to iterate over a bucket array, I like the new version more. But I see you did it this way to stay consistent with the other methods.
-------------
PR: https://git.openjdk.java.net/jdk17u-dev/pull/132
More information about the jdk-updates-dev
mailing list