RFR: 8375621: Move RBTree implementation to inline file to minimize included headers [v2]

Casper Norrbin cnorrbin at openjdk.org
Mon Jan 19 14:54:35 UTC 2026


On Mon, 19 Jan 2026 12:33:05 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   feedback fixes
>
> src/hotspot/share/utilities/rbTree.inline.hpp line 236:
> 
>> 234: 
>> 235: template <typename K, typename V>
>> 236: inline const RBNode<K, V>* RBNode<K, V>::next() const { return static_cast<const RBNode<K, V>*>(IntrusiveRBNode::next()); }
> 
> Not a strong request, but I would like to suggest that you skip writing one-liners for all these functions in the inline.hpp file:
> Suggestion:
> 
> template <typename K, typename V>
> inline const RBNode<K, V>* RBNode<K, V>::next() const {
>   return static_cast<const RBNode<K, V>*>(IntrusiveRBNode::next());
> }

I have changed all the one-liners to "normal" functions.

> src/hotspot/share/utilities/rbTree.inline.hpp line 1159:
> 
>> 1157: template <MemTag mem_tag, AllocFailType strategy>
>> 1158: inline void* RBTreeCHeapAllocator<mem_tag, strategy>::allocate(size_t sz) {
>> 1159:   return static_cast<void*>(AllocateHeap(sz, mem_tag, strategy));
> 
> Do you really need the cast here?

We don't. I removed it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29295#discussion_r2705079730
PR Review Comment: https://git.openjdk.org/jdk/pull/29295#discussion_r2705083815


More information about the hotspot-dev mailing list