[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8292741: Convert JvmtiTagMapTable to ResourceHashtable [v7]
From:       David Holmes <dholmes () openjdk ! org>
Date:       2022-12-15 1:56:09
Message-ID: 31ZthS6SqGpb-qVWc9EOZFk0x2KYf16KDL5hecw8HmY=.b1ee5b8e-1be0-4c20-bb33-c68d7202d0b2 () github ! com
[Download RAW message or body]

On Wed, 14 Dec 2022 13:28:02 GMT, Afshin Zafari <duke@openjdk.org> wrote:

> > src/hotspot/share/prims/jvmtiTagMap.cpp line 1262:
> > 
> > > 1260:   // and record the reference and tag value.
> > > 1261:   //
> > > 1262:   bool do_entry(JvmtiTagMapKey& key, jlong& value) {
> > 
> > I still see no point in this method returning a bool when it only ever returns \
> > true.
> 
> 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.

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic