RFR: 8314114: Fix -Wconversion warnings in os code, primarily linux [v2]
Coleen Phillimore
coleenp at openjdk.org
Fri Aug 11 16:40:28 UTC 2023
On Fri, 11 Aug 2023 15:52:42 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> One of you wants checked_cast<> everywhere and another of you doesn't. Given that we don't know from local code inspection that the result fits in an int, I chose checked_cast<> for these calls.
>
> What are the costs of checked_cast?
checked_cast instantiates a template or two. I haven't measured code bloat. It carries risk of asserting for odd inputs that used to be truncated. In this case, it seems like a good place to have the assert. In obvious places, it seems like noise.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15229#discussion_r1291569289
More information about the hotspot-dev
mailing list