Repository navigation
Conversation
When we need to split nodes in a bforest to perform an insertion, allocate the worst case depth + 1 nodes all up front so that the insertion atomically completes or fails. Otherwise the bforest can silently drop nodes that were in the tree.
| assert_eq!(m.tpath(110, f, &()), "node2[0]--node0[0]"); | ||
| assert_eq!(m.tpath(140, f, &()), "node2[0]--node0[3]"); | ||
| assert_eq!(m.tpath(210, f, &()), "node2[1]--node1[0]"); | ||
| assert_eq!(m.tpath(270, f, &()), "node2[1]--node1[6]"); | ||
| assert_eq!(m.tpath(310, f, &()), "node2[2]--node3[0]"); | ||
| assert_eq!(m.tpath(810, f, &()), "node2[7]--node8[0]"); | ||
| assert_eq!(m.tpath(870, f, &()), "node2[7]--node8[6]"); | ||
| assert_eq!(m.tpath(110, f, &()), "node1[0]--node0[0]"); | ||
| assert_eq!(m.tpath(140, f, &()), "node1[0]--node0[3]"); | ||
| assert_eq!(m.tpath(210, f, &()), "node1[1]--node2[0]"); | ||
| assert_eq!(m.tpath(270, f, &()), "node1[1]--node2[6]"); | ||
| assert_eq!(m.tpath(310, f, &()), "node1[2]--node5[0]"); | ||
| assert_eq!(m.tpath(810, f, &()), "node1[7]--node10[0]"); | ||
| assert_eq!(m.tpath(870, f, &()), "node1[7]--node10[6]"); |
There was a problem hiding this comment.
A bunch of these tests change because the node ids are different now. This is because 1) when reserving, the nodes end up in the free list in the opposite order in which the were allocated and 2) we reserve the worst case each time instead of the exact amount needed. I was thinking that making those changes isn't worth the added complexity.
|
I'll defer this to @fitzgen as he's more familiar with this than I, but I'd recommend against a test-only bool to fail allocations and instead relying only on the OOM test/fuzz harness we have for handling that. Could the tests be moved over there for OOM-related things? |
This reverts commit 20206e5.
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "cranelift", "fuzzing"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
When we need to split nodes in a bforest to perform an insertion, allocate
the worst case depth + 1 nodes all up front so that the insertion
atomically completes or fails. Otherwise the bforest can drop nodes that
were in the tree.