summary refs log tree commit diff
path: root/library/alloc/src/collections/btree/node.rs
AgeCommit message (Collapse)AuthorLines
2020-08-14Rollup merge of #75519 - ssomers:btree_splitpoint_cleanup, r=Mark-SimulacrumTyler Mandry-31/+11
BTreeMap: refactor splitpoint and move testing over to unit test r? @Mark-Simulacrum
2020-08-14Rollup merge of #75195 - ssomers:btree_split_up_into_kv_mut, r=Mark-SimulacrumTyler Mandry-6/+16
BTreeMap: purge innocent use of into_kv_mut Replace the use of `into_kv_mut` into more precise calls. This makes more sense if you know that the single remaining use of `into_kv_mut` is in fact evil and can be trialled in court (#75200) and sent to a correction facility (#73971). No real performance difference reported (but functions that might benefit a tiny constant bit like `BTreeMap::get_mut` aren't benchmarked): ``` benchcmp old new --threshold 5 name old ns/iter new ns/iter diff ns/iter diff % speedup btree::map::clone_fat_100 63,073 59,256 -3,817 -6.05% x 1.06 btree::map::iter_100 3,514 3,235 -279 -7.94% x 1.09 ```
2020-08-14BTreeMap: refactor splitpoint and move testing over to unit testStein Somers-31/+11
2020-08-14Auto merge of #74777 - ssomers:btree_cleanup_7, r=Mark-Simulacrumbors-20/+16
Stop BTreeMap casts from reborrowing Down in btree/node.rs, the interface and use of `cast_unchecked` look a bit shady. It's really just there for inverting `forget_type` which does not borrow. By borrowing we can't write the same `cast_unchecked` in the same way at the Handle level. No change in undefined behaviour or performance.
2020-08-13Stop BTreeMap casts from reborrowingStein Somers-20/+16
2020-08-12Somewhat complicated way to respect BTreeMap's node length invariantStein Somers-16/+65
2020-08-11BTreeMap: purge innocent use of into_kv_mutStein Somers-6/+16
2020-08-09BTreeMap: better distinguish the root holder from the root nodeStein Somers-9/+11
2020-08-07BTreeMap: better way to postpone root access in DrainFilterStein Somers-2/+2
2020-08-04Auto merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrumbors-44/+42
Clarify reuse of a BTreeMap insert support function and treat split support likewise r? @Mark-Simulacrum
2020-08-02Separate off a leafy insert function instead of lying, and split split similarlyStein Somers-44/+42
2020-08-02Move bulk of BTreeMap::insert method down to new method on handleStein Somers-5/+61
2020-08-03Rollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-SimulacrumYuki Okushi-6/+14
BTreeMap: define forget_type only when relevant Similar to `forget_node_type` for handles. No effect on generated code, apart maybe from the superfluous calls that might not have been optimized away. r? @Mark-Simulacrum
2020-08-03Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, ↵Yuki Okushi-7/+9
r=Mark-Simulacrum BTreeMap::drain_filter should not touch the root during iteration Although Miri doesn't point it out, I believe there is undefined behaviour using `drain_filter` when draining the 11th-last element from a tree that was larger. When this happens, the last remaining child nodes are merged, the root becomes empty and is popped from the tree. That last step establishes a mutable reference to the node elected root and writes a pointer in `node::Root`, while iteration continues to visit the same node. This is mostly code from #74437, slightly adapted.
2020-08-01BTreeMap::drain_filter no longer touches the root during iterationStein Somers-7/+9
2020-08-01Define forget_type only when relevantStein Somers-6/+14
2020-07-28Remove into_slices and its unsafe blockStein Somers-10/+3
2020-07-27mv std libs to library/mark-0/+1488