RFR: 8296139: Make GrowableBitMap the base class of all implementations [v4]
Xin Liu
xliu at openjdk.org
Wed Nov 9 18:39:32 UTC 2022
On Wed, 9 Nov 2022 17:02:53 GMT, Volker Simonis <simonis at openjdk.org> wrote:
>> Xin Liu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>>
>> - Merge branch 'master' into JDK-8296139
>> - Bring back verify_size to the constructor of BitMap.
>>
>> Also resume the underlying member data to be private. Subclasses of
>> GrowableBitMap update them using update(map, size).
>> - Reivew comments from stefank
>> - 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.
>> - Add unittest for Arena.
>> - Avoid polluting namespace.
>>
>> uses qualified bm_word_t and idx_t.
>> - Change ResourceBitMap to subclass of ArenaBitMap.
>> - Add GrowableBitMap.
>
> src/hotspot/share/utilities/bitMap.cpp line 637:
>
>> 635: template class GrowableBitMap<ArenaBitMap>;
>> 636: template class GrowableBitMap<ResourceBitMap>;
>> 637: template class GrowableBitMap<CHeapBitMap>;
>
> Do you really need this explicit template instantiations? I think such code is only required in libraries where you want to be sure to have specific instantiations even though they are not used within the library itself. But here you will get these instantiations anyway whenever `ArenaBitMap`, `ResourceBitMap` or `CHeapBitMap` is used because they are derived from `GrowableBitMap<ArenaBitMap>`, `GrowableBitMap<ResourceBitMap>` and `GrowableBitMap<CHeapBitMap>` respectively.
hi, Volker,
-------------
PR: https://git.openjdk.org/jdk/pull/10941
More information about the hotspot-runtime-dev
mailing list