RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method
Johan Sjölen
jsjolen at openjdk.org
Fri Aug 25 08:35:08 UTC 2023
On Fri, 25 Aug 2023 02:41:19 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The `find` method now is
>> ```C++
>> template<typename T>
>> int find(T* token, bool f(T*, E)) const {
>> ...
>>
>> Any other functions which use this are also changed.
>> Local linux-x64-debug hotspot:tier1 passed. Mach5 tier1 build on linux and Windows passed.
>
> src/hotspot/share/utilities/growableArray.hpp line 213:
>
>> 211:
>> 212: template<typename T>
>> 213: int find(T* token, bool f(T*, E)) const {
>
> Pardon my ignorance here, but what is the type relationship between T and E?
It's arbitrary and chosen by the caller through `f`, so I can't say :-). The best use case we have now is when you only have an `int` which uniquely describes an `LGRPSpace`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1305363537
More information about the hotspot-dev
mailing list