RFR: 8339648: ZGC: Division by zero in rule_major_allocation_rate [v2]

Matthias Baesken mbaesken at openjdk.org
Wed Sep 11 11:13:04 UTC 2024


On Wed, 11 Sep 2024 09:41:14 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> I am fine with this change. But I am not 100% about the use of `std::numeric_limits<double>::infinity()`. Maybe someone else can chime in.
> 
> Not sure if there are any other places we have expect division by zero to result in infinity.

Thanks for the review !

Seems this exists since c++11  https://en.cppreference.com/w/cpp/types/numeric_limits/infinity  so usage should be okay.
We also find it in libsimdsort (linux only in OpenJDK however) https://github.com/openjdk/jdk/blob/master/src/java.base/linux/native/libsimdsort/xss-common-includes.h#L47

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

PR Comment: https://git.openjdk.org/jdk/pull/20888#issuecomment-2343339018


More information about the hotspot-gc-dev mailing list