RFR: 8337995: ZUtils::fill uses std::fill_n

Hamlin Li mli at openjdk.org
Wed Dec 11 10:13:40 UTC 2024


On Wed, 11 Dec 2024 09:51:39 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> The code change itself looks good.
>> 
>> Just got one question about the rule, I know a c++ compiler needs to support c++14, as `std::fill_n` is introduced in 17/20/26, so seems we should not use it in hotspot code, is this the reason why we can not use `std::fill_n` here? Or there is a place recording which libaraies/files are allowed or not allowed in hotspot? Thanks!
>
>> The code change itself looks good.
>> 
>> Just got one question about the rule, I know a c++ compiler needs to support c++14, as `std::fill_n` is introduced in 17/20/26, so seems we should not use it in hotspot code, is this the reason why we can not use `std::fill_n` here? Or there is a place recording which libaraies/files are allowed or not allowed in hotspot? Thanks!
> 
> The hotspot style guide only allows a few libraries from the standard library to be used (https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md?plain=1#L531). A previous paragraph (https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md?plain=1#L377) states that unless explicitly allowed, use of other features is disallowed.

@tschatzl Thank you for the information!

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

PR Comment: https://git.openjdk.org/jdk/pull/22667#issuecomment-2535389567


More information about the hotspot-gc-dev mailing list