[jdk17u-dev] RFR: 8271506: Add ResourceHashtable support for deleting selected entries

Goetz Lindenmaier goetz at openjdk.java.net
Mon Jan 31 13:37:14 UTC 2022


On Mon, 31 Jan 2022 13:02:23 GMT, Thomas Stuefe <stuefe 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.
>
> 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.

I could have taken bucket_at() wrapping the const_cast, too. But that calls 
table() which is not in 17, either. So I thought I only take this method and modify it.
Node ** is needed because below the buckets might be updated with the new list start.

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

PR: https://git.openjdk.java.net/jdk17u-dev/pull/132


More information about the jdk-updates-dev mailing list