RFR: 8292741: Convert JvmtiTagMapTable to ResourceHashtable [v7]

David Holmes dholmes at openjdk.org
Mon Jan 16 23:21:20 UTC 2023


On Thu, 15 Dec 2022 01:53:32 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> In the `iterate` method of ResourceHashTable, in respurceHash.hpp lines 227-240 copied here, requires a function that returns boolean. If returned false the iterate will break.
>> 
>>  template<typename Function>
>>   void iterate(Function function) const { // lambda enabled API
>>     Node* const* bucket = table();
>>     const unsigned sz = table_size();
>>     while (bucket < bucket_at(sz)) {
>>       Node* node = *bucket;
>>       while (node != NULL) {
>>         bool cont = function(node->_key, node->_value);    // <--------------******
>>         if (!cont) { return; }
>>         node = node->_next;
>>       }
>>       ++bucket;
>>     }
>>   }
>> 
>> The other `iterate` methods are wrappers around this one.
>> Always returning true means to continue iterating over all the existing items. 
>> The former base table for jvmtiTagMapTable needs the `do_entry` be `void`.
>
> Okay in that case please add to the comment preceding this method:
> 
> // Always return true so the iteration continues.

You didn't add the comment I requested.

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

PR: https://git.openjdk.org/jdk/pull/11288


More information about the serviceability-dev mailing list