RFR: 8296139: Make GrowableBitMap the base class of all implementations [v2]

Xin Liu xliu at openjdk.org
Fri Nov 4 23:37:33 UTC 2022


On Fri, 4 Nov 2022 09:39:49 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refactor GrowableBitMap using C++ CRTP
>>   
>>   With CPTP, we don't need to have explicit Allocators. Subclasses expose
>>   allocate/free member functions upward to GrowableBitMap<BitMapWithAllocator>. This
>>   aproach is similar to GrowableArray.
>
> src/hotspot/share/utilities/bitMap.hpp line 170:
> 
>> 168: 
>> 169:   // Protected constructor and destructor.
>> 170:   BitMap(bm_word_t* map, idx_t size_in_bits) : _map(map), _size(size_in_bits) {}
> 
> Is there a reason why the verify_size was removed?

Confirm that this got lost in shuffle. `verify_size` is zero-cost in release build. I will put it back. Thanks. 

I also notice that some static member functions such as `raw_to_words_align_down` can be decorated using constexpr. We could change them in a separated JBS.

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

PR: https://git.openjdk.org/jdk/pull/10941


More information about the hotspot-runtime-dev mailing list