RFR: 8345314: Add a red–black tree as a utility data structure [v7]

Johan Sjölen jsjolen at openjdk.org
Wed Jan 8 11:04:39 UTC 2025


On Tue, 7 Jan 2025 17:11:20 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   renamed coloring functions
>
> src/hotspot/share/utilities/rbTree.hpp line 308:
> 
>> 306: 
>> 307:   void free(void* ptr) { os::free(ptr); }
>> 308: };
> 
> An issue with this allocator is that it doesn't call destructors on `free`. I think we should add this, or any future users may leak memory by mistake.

Some more thoughts: It's not the allocator that should run the destructor, but the RBTree itself. It should probably enforce that the key is a trivial type also.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22360#discussion_r1907005846


More information about the hotspot-dev mailing list