RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v5]

Afshin Zafari azafari at openjdk.org
Thu Sep 28 10:03:26 UTC 2023


On Thu, 28 Sep 2023 02:04:12 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> This change came after fixing a merge conflict.
>> In `mutableNUMASpace.cpp`, at lines 163, 182, 202 and 586 the `find` function is called in this way: 
>> 
>> int i = lgrp_spaces()->find(&lgrp_id, LGRPSpace::equals);
>> 
>> where `lgrp_id` is `int`. Therefore, the `LGRPSpace::equals` has to take an `int*` in its first argument. The definition of `find` is:
>> 
>> int find(T* token, bool f(T*, const E&)) const {
>
> After JDK-8316115 `lgrp_id` is `uint`.

Even after the JDK-8316115, the local `lgrp_id` is defined as `int` and compared with `-1` in a few lines before calling the `find`.  The local `int` definition is kept as it is, but the pointer to it is casted to `uint*`.
Maybe @albertnetymk has to double check if this is not overlooked in JDK-8316115 fix, since the line `int lgrp_id = thr->lgrp_id();` (dates back  to 15 years ago) is casting now from `uint` to `int` and comparing with `-1`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1339860082


More information about the serviceability-dev mailing list