RFR: 8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable

Kim Barrett kbarrett at openjdk.org
Fri Jul 12 09:35:58 UTC 2024


On Wed, 10 Jul 2024 21:00:25 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Please review this change to SimpleCompactHashtable to remove some
>> -Wzero-as-null-pointer-constant warnings when enabled.
>> 
>> It has some pointer-typed members that were being initialized with 0, and are
>> now initialized with nullptr.
>> 
>> The constructor was also changed to initialize in the mem-initializer-list
>> rather than as assignments in the body.
>> 
>> In both the constructor and the reset function, the _base_address member was
>> added to the initialization/assignment sequence.  It was previously missing,
>> so was uninitialized by the constructor and left unchanged by reset.  This
>> appears to have been a "harmless" bug; at least, I couldn't find any way to
>> use the "unset" value.
>> 
>> Testing: mach5 tier1
>
> Looks good.

Thanks for reviews @coleenp and @dholmes-ora

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

PR Comment: https://git.openjdk.org/jdk/pull/20113#issuecomment-2225192671


More information about the hotspot-runtime-dev mailing list