RFR: 8270061: Change parameter order of ResourceHashtable

Ioi Lam iklam at openjdk.java.net
Wed Jul 28 20:42:37 UTC 2021


On Tue, 27 Jul 2021 20:50:35 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> The template parameter for ResourceHashtable is currently in this order:
>> 
>> template<
>>     typename K, typename V,
>>     unsigned (*HASH)  (K const&)           = primitive_hash<K>,
>>     bool     (*EQUALS)(K const&, K const&) = primitive_equals<K>,
>>     unsigned SIZE = 256,
>>     ResourceObj::allocation_type ALLOC_TYPE = ResourceObj::RESOURCE_AREA,
>>     MEMFLAGS MEM_TYPE = mtInternal
>>     >
>> class ResourceHashtable {...}
>> 
>> 
>> However, more often than not, default values of `HASH` and `EQUALS` will be used, where the other parameters may need to be specified.
>> 
>> We should move the `HASH` and `EQUALS` parameters to the end of the parameter list.
>
> Oh but MEMFLAGS is generally found after the allocation type and I thought there were more resource allocated resource hashtables (at least initially).

Thanks @coleenp and @tstuefe for the review.

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

PR: https://git.openjdk.java.net/jdk/pull/4912


More information about the hotspot-dev mailing list