Uh oh!
There was an error while loading. Please reload this page.
BTreeMap: consider leaf nodes to have empty edges - #77025
Conversation
ssomers
commented
Sep 21, 2020
Some of the stuff split off into #77005. The rest is a little disappointing. The only way I found to make gdb_providers work is obnoxious. I couldn't python to access the Performance of insertion may be better for reasonably sized key/values. |
ssomers
commented
Sep 24, 2020
Found tricks to simplify the gdb introspection. The result is still a bit disappointing but acceptable to me. |
Uh oh!
There was an error while loading. Please reload this page.
Mark-Simulacrum
commented
Sep 24, 2020
I'll wait for #77005 to land before going ahead to review this. |
ssomers
commented
Sep 25, 2020
And I'll wait for #77005 to land to rebase. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I think the unsafe (that I transplanted from LeafNode::new) is silly. The function does nothing unsafe. The value returned does not own any keys or values yet. I'm pretty sure that after wrapping it in BoxedNode, you could still wreak havoc without invoking any unsafe function.
Mark-Simulacrum
commented
Sep 26, 2020
Hm, so I'm not sure this is a win. The node code is already pretty scattered (at least in my mind) -- and introducing another type parameter that readers need to figure out feels pretty bad, especially because it doesn't look like it really cleans anything up in a major way, just introduces additional indirection (at the type-level, at least). Can you say more about the motivation for this? Perhaps there's an end goal in mind here that I'm not yet seeing? |
The motivation is in this PR's description. The first point can be covered by adapting comments, the second point is somewhat addressed by the |
ssomers
commented
Sep 26, 2020
Or very concretely, if you try to treat edges in the you end up realizing that the debug_assert in |
ssomers
commented
Oct 1, 2020
Failing to find ways to make this more appealing |
…mments, r=Mark-Simulacrum BTreeMap: admit the existence of leaf edges in comments The btree code is ambiguous about leaf edges (i.e., edges within leaf nodes). Iteration relies on them heavily, but some of the comments suggest there are no leaf edges (extracted from rust-lang#77025) r? @Mark-Simulacrum
Tried to make internal and leaf nodes more alike, because:
r? @Mark-Simulacrum