RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v56]
    Emanuel Peter 
    epeter at openjdk.org
       
    Fri May  2 09:11:08 UTC 2025
    
    
  
On Fri, 2 May 2025 08:19:17 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/utilities/intn_t.hpp line 37:
>> 
>>> 35: template <unsigned int n>
>>> 36: class intn_t {
>>> 37:   static_assert(n > 0 && n <= 8, "should not be larger than char");
>> 
>> Does `n` stand for the number of bits? Maybe you could write `bits` or even `NUM_BITS` instead?
>
> Maybe it's not worth it. But then it should be explained in the class description comment above :)
Suggestion:
  static_assert(0 < n && n <= 8, "should not be larger than char");
And I like things ordered according to their value :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2071284869
    
    
More information about the hotspot-compiler-dev
mailing list