RFR: 8314114: Fix -Wconversion warnings in os code, primarily linux [v2]

Thomas Stuefe stuefe at openjdk.org
Sat Aug 12 06:59:58 UTC 2023


On Fri, 11 Aug 2023 16:33:41 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> 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.

@coleenp: The only case where sysconf could be not a small positive integer is when it returns an error, -1, and checked_cast will not catch that since it still fits an int. 

Up to you, but I'd either leave this unchecked, or convert the parameter for set_processor_count to unsigned.

@dean-long:
> change func() to a template function

I hope we don't do that, that sounds terrible. I still have to find a modern IDE that can work well with all the template code we have. The more templates we use, the worse features like call graph display work in IDEs like CDT or CLion.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15229#discussion_r1292107207


More information about the hotspot-dev mailing list