replacement in sanakirja-core/src/lib.rs at line 68
[3.1440]→[3.1440:1477](∅→∅) − /// references to out-of-tree pages.
edit in sanakirja-core/src/lib.rs at line 203
+ assert_eq!(k.align_offset(K::ALIGN), 0);
replacement in sanakirja-core/src/lib.rs at line 206
[3.2159]→[3.2159:2225](∅→∅) − let va = V::ALIGN;
− let v_off = (ks + va - 1) & !(va - 1);
+ let v_off = (ks + V::ALIGN - 1) & !(V::ALIGN - 1);
replacement in sanakirja-core/src/lib.rs at line 259
replacement in sanakirja-core/src/lib.rs at line 274
[3.1928]→[3.1928:1993](∅→∅) − /// `CowPage` to avoid checking the "dirty" bit at running time.
+ /// `CowPage` to avoid checking the "dirty" bit at runtime.
replacement in sanakirja-core/src/lib.rs at line 288
− let crc = (self.0.data as *mut u32).offset(1);
+ let crc = (self.0.data as *mut u32).add(1);
replacement in sanakirja-core/src/btree/page.rs at line 110
[3.5381]→[3.5381:5475](∅→∅) − // position `-1` has a right child (which is the left child of the
− // first element).
+ // position `-1` has a right child (which is the first element's
+ // left child).
replacement in sanakirja-core/src/btree/page.rs at line 143
[3.4501]→[3.4501:4615](∅→∅) − if c.cur < c.total as isize {
− c.cur += 1;
− true
− } else {
− false
+ if c.cur >= c.total as isize {
+ return false;
edit in sanakirja-core/src/btree/page.rs at line 146
replacement in sanakirja-core/src/btree/page.rs at line 151
[3.4680]→[3.4680:4803](∅→∅) − if c.cur > 0 {
− c.cur -= 1;
− true
− } else {
− c.cur = -1;
− false
+ if c.cur < 0 {
+ return false;
edit in sanakirja-core/src/btree/page.rs at line 154
edit in sanakirja-core/src/btree/page.rs at line 158
[3.5746]→[3.5746:5809](∅→∅) − // This is the first non-trivial method, let's explain it.
replacement in sanakirja-core/src/btree/page.rs at line 171
[3.6282]→[3.6282:6506](∅→∅) − // This means that the header may be followed by
− // padding. These are constants known at compile-time, by
− // the way, so `al` and `hdr` are optimised away by the
− // compiler.
+ // This means that the header may be followed by padding
+ // (in order to align the entries). These are constants
+ // known at compile-time, so `al` and `hdr` are optimised
+ // away by the compiler.
replacement in sanakirja-core/src/btree/page.rs at line 183
[3.6896]→[3.6896:6952](∅→∅) − // `f * cur` bytes after the padded header:
+ // `f * cur` bytes after the padded header (because
+ // `size_of` includes alignment padding).
replacement in sanakirja-core/src/btree/page.rs at line 225
[3.4988]→[3.4988:5088](∅→∅) − unsafe { *(page.data.as_ptr().add((HDR + c.cur as usize * 8) - 8) as *const u64) };
+ unsafe { *(page.data.as_ptr().offset((HDR as isize + c.cur * 8) - 8) as *const u64) };
replacement in sanakirja-core/src/btree/page.rs at line 233
[3.5305]→[3.8676:8763](∅→∅) − assert!(c.cur < c.total as isize && HDR as isize + c.cur * 8 - 8 <= 4088);
+ assert!(c.cur < c.total as isize && HDR as isize + c.cur * 8 <= 4088);
replacement in sanakirja-core/src/btree/page.rs at line 256
[3.9175]→[3.9175:9275](∅→∅) − // Just read the tuple, as we did multiple times
− // before.
+ // Just read the tuple and return it.
replacement in sanakirja-core/src/btree/page.rs at line 317
[3.10774]→[3.10774:10826](∅→∅) − // leaf). This is implemented the `put` module.
+ // leaf). This is implemented in the `put` module.
replacement in sanakirja-core/src/btree/page.rs at line 341
[3.11472]→[3.582:633](∅→∅),
[3.633]→[2.54:84](∅→∅),
[2.84]→[3.659:715](∅→∅),
[3.659]→[3.659:715](∅→∅) − unsafe fn put_mut(
− page: &mut MutPage,
− c: &mut Self::Cursor,
− k0: &K,
− v0: &V,
− r: u64,
− ) {
+ unsafe fn put_mut(page: &mut MutPage, c: &mut Self::Cursor, k0: &K, v0: &V, r: u64) {
replacement in sanakirja-core/src/btree/page.rs at line 352
[3.963]→[3.963:1070](∅→∅) − unsafe fn set_left_child(
− page: &mut MutPage,
− c: &Self::Cursor,
− l: u64
− ) {
+ unsafe fn set_left_child(page: &mut MutPage, c: &Self::Cursor, l: u64) {
replacement in sanakirja-core/src/btree/page.rs at line 366
[3.11050]→[3.11050:11127](∅→∅) − assert!(!c.is_leaf && c.cur >= 0 && (c.cur as usize) < c.total + 1);
+ assert!(!c.is_leaf && c.cur >= 0 && (c.cur as usize) <= c.total);
replacement in sanakirja-core/src/btree/page.rs at line 680
[3.5313]→[3.5313:5398](∅→∅) − panic!("off = {:?}, size = {:?}", off, core::mem::size_of::<Tuple<K, V>>());
+ panic!(
+ "off = {:?}, size = {:?}",
+ off,
+ core::mem::size_of::<Tuple<K, V>>()
+ );
replacement in sanakirja-core/src/btree/mod.rs at line 77
[3.9813]→[3.9813:9882](∅→∅) − /// element. In that sense, this is not the symmetric of `next`.
+ /// element. Note that this is not the symmetric of `next`.
replacement in sanakirja-core/src/btree/mod.rs at line 114
[3.10740]→[3.10740:10804](∅→∅) − /// if `v0.is_none()`, and to `(k0, v0)` if `v0.is_some()`.
+ /// if `v0.is_none()`, and to `(k0, v0)` if `v0.is_some()`. If a
+ /// match is found (on `k0` only if `v0.is_none()`, on `(k0, v0)`
+ /// else), return the match along with the right child.
+ ///
+ /// Else (in the `Err` case of the `Result`), return the position
+ /// at which `(k0, v0)` can be inserted.
edit in sanakirja-core/src/btree/mod.rs at line 127
+
+ /// Splits the cursor into two cursors: the elements strictly
+ /// before the current position, and the elements greater than or
+ /// equal the current element.
replacement in sanakirja-core/src/btree/mod.rs at line 157
[3.44884]→[3.44884:45122](∅→∅) − /// `replace`. The "double insertion" is only ever used when
− /// deleting, and when the right child of a deleted entry (in an
− /// internal node) has split while we were looking for a
− /// replacement for the deleted entry.
+ /// `replace`. When `k1v1.is_some()`, we insert both `(k0, v0)`
+ /// (as a replacement), followed by `(k1, v1)`. This is only ever
+ /// used when deleting, and when the right child of a deleted
+ /// entry (in an internal node) has split while we were looking
+ /// for a replacement for the deleted entry.
replacement in sanakirja-core/src/btree/mod.rs at line 190
[3.1533]→[3.1533:1572](∅→∅) − ) {
− unimplemented!()
− }
replacement in sanakirja-core/src/btree/mod.rs at line 197
[3.1703]→[3.1703:1742](∅→∅) − ) {
− unimplemented!()
− }
replacement in sanakirja-core/src/btree/mod.rs at line 424
[3.1286]→[3.5515:5650](∅→∅) − // Here, either rc > 1, or else `P::move_next` returned
− // `false`, meaning that the cursor is after the last element.
+ // Here, either rc > 1 (in which case the only thing we need
+ // to do in this iteration is to decrement the RC), or else
+ // `P::move_next` returned `false`, meaning that the cursor is
+ // after the last element (in which case we are done with this
+ // page, and also need to decrement its RC, in order to free
+ // it).
edit in sanakirja-core/src/btree/cursor.rs at line 121
+ /// Push the leftmost path starting at page `left_page` onto the
+ /// stack.
replacement in sanakirja-core/src/btree/cursor.rs at line 147
[3.39945]→[3.39945:40187](∅→∅) − // An invariant of cursors, fundamental to understand the `next`
− // and `prev` functions below, is that the lower levels (in the
− // tree, upper levels on the stack) are the left children of the
− // cursor's position on a page.
+ // An invariant of cursors, fundamental to understanding the
+ // `next` and `prev` functions below, is that the lower levels (in
+ // the tree, upper levels on the stack) are the left children of
+ // the cursor's position on a page.
replacement in sanakirja-core/src/btree/cursor.rs at line 160
[3.34117]→[3.66035:66162](∅→∅),
[3.66035]→[3.66035:66162](∅→∅) − // Set the "cursor stack" by setting a skip list cursor in
− // each page from the root to the appropriate leaf.
+ // Set the "cursor stack" by setting a cursor in each page
+ // on a path from the root to the appropriate leaf.
replacement in sanakirja-core/src/btree/cursor.rs at line 163
[3.7699]→[3.7699:7738](∅→∅) − // Start back from the bottom.
+ // Start from the bottom of the stack, which is also the root
+ // of the tree.