RFR: 8345314: Add a red–black tree as a utility data structure [v7]
Casper Norrbin
cnorrbin at openjdk.org
Thu Jan 9 14:08:00 UTC 2025
On Thu, 9 Jan 2025 13:32:22 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
>> I realize that a simpler test would be to just create random nodes (key=size, value=this node's address), then add/remove randomly while checking that the node address still equals the node value. The old implementation would fail that test.
>
> (Forgot to mention) I added a gtest that allocates and stores nodes together with their keys, then performs a bunch of deletions to then check that the value of the nodes remain unchanged. Can add another with addresses too to be extra safe
I added a second test which creates nodes and stores their address as values. We then remove ~1/5 of all nodes. We then check that all remaining nodes' value hasn't changed and still equals the address.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22360#discussion_r1908864415
More information about the hotspot-dev
mailing list