RFR: 8367981: Refine CompactHashtable comments
Francesco Andreuzzi
fandreuzzi at openjdk.org
Thu Sep 18 11:23:40 UTC 2025
On Thu, 18 Sep 2025 11:17:25 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:
>> Hi,
>> Can you help to review this patch?
>>
>> The comments of CompactHashtable and related classes are out of date, and some comments are unclear, wrong or misleading.
>> As the related classes are used in more and more scenarios, it's helpful to update the comments.
>>
>> Thanks
>
> src/hotspot/share/classfile/compactHashtable.cpp line 195:
>
>> 193: size_t SimpleCompactHashtable::calculate_header_size() {
>> 194: // We have 5 fields. Each takes up sizeof(intptr_t). See WriteClosure::do_u4
>> 195: constexpr size_t bytes = sizeof(intptr_t) * 5;
>
> The whole method could perhaps become a `constexpr`
And you could have the assertion below just after the class is defined
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27360#discussion_r2358687022
More information about the hotspot-runtime-dev
mailing list