RFR: 8296139: Make GrowableBitMap the base class of all implementations [v2]
Xin Liu
xliu at openjdk.org
Fri Nov 4 21:56:25 UTC 2022
On Fri, 4 Nov 2022 13:48:04 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.cpp line 91:
>
>> 89: // Reuse reallocate to ensure that the new memory is cleared.
>> 90: bm_word_t* map = reallocate(nullptr, 0, size_in_bits, clear);
>> 91: update(map, size_in_bits);
>
> Both CHeapBitMap and AreanBitMap perform this "initialization". I propose that this instead call the GrowableBitMap::initialize function.
I agree! 'initialize()' is clearer to reflect the purpose of code.
-------------
PR: https://git.openjdk.org/jdk/pull/10941
More information about the hotspot-runtime-dev
mailing list