pijul nest
guest [sign in]

Changes in the `Storable` trait (write_to_page now takes a transaction)

pmeunier
Dec 13, 2022, 12:54 PM
76S6EF7U7JCK2IDKWZZLGNCPIFDPW6NRM6UZQFPT6MMWY44L6XEAC

Dependencies

  • [2] M6PHQUGL fallocate only when necessary
  • [3] 3MCRJULO Fixing corruption issues
  • [4] HCDD6FX7 Fixing some comments and reformatting
  • [5] HJ6VZ7HF Fixing a wrong CRC computation
  • [6] OP6SVMOD Resetting history
  • [7] SYURNHHL Adding the `put_mut` and `set_left_child` methods
  • [8] AOX2XQIS Actually, with the correct functions, Unsized pages are always slower than Sized pages (especially for writing)
  • [9] 6UVFCERM Formatting, debugging, etc.
  • [10] ESUI5EUZ Making as_page() unsafe
  • [11] LSQ6V7M6 Cleanup + docs
  • [12] 7T2CCH3P Fixing a segfault (wrong offset in page_unsized::del)
  • [13] HN6Z5DU4 Cleanup
  • [14] H3FVSQIQ Unsized pages
  • [15] DV4A2LR7 Double-inserts (rebalancing near an internal deletion)
  • [16] QEUTVAZ4 Splitting btree::page
  • [17] OTWDDJE7 Trait/type cleanup
  • [18] TSMS6W4D Fully commented implementation of Sized nodes + massive cleanup
  • [19] OFINGD26 implementing prev() on cursors (+ some cleanup)
  • [20] XEU2QVLC Debugging after plugging this into Pijul
  • [21] DASFQGOR Debugging
  • [22] WS4ZQM4R Debugging, tests, etc.
  • [23] 73Z2UB3J Cleanup + comments
  • [24] W2MIZD5B Single file databases + CRC for the root pages (checking the other pages makes everything very slow)
  • [25] 5JOD7M26 Modifying cursor lengths when appending
  • [26] G4JEQLLX Debugging synchronisation
  • [27] SO25TWFL A few features for integrating it into Pijul
  • [28] 52X5P7ND Cleaning up the unsized part
  • [29] Q7DRIBBR Debugging replace (which cannot be del+put)
  • [30] CCNPHVQC Cleanup, comments, renaming
  • [31] QYDGYIZR Split trait Representable into its mandatory part and an optional part

Change contents

  • replacement in sanakirja-core/src/lib.rs at line 106
    [6.897][6.231:288](),[6.231][6.231:288]()
    unsafe fn write_to_page(&self, p: *mut u8) {
    [6.897]
    [6.288]
    unsafe fn write_to_page<T: AllocPage>(&self, _: &mut T, p: *mut u8) {
  • replacement in sanakirja-core/src/lib.rs at line 161
    [6.1570][6.1570:1618]()
    unsafe fn write_to_page(&self, p: *mut u8);
    [6.1570]
    [6.1618]
    unsafe fn write_to_page<T: AllocPage>(&self, t: &mut T, p: *mut u8);
  • replacement in sanakirja-core/src/lib.rs at line 359
    [6.1127][6.1127:1176]()
    unsafe fn write_to_page(&self, p: *mut u8) {
    [6.1127]
    [6.1176]
    unsafe fn write_to_page<T>(&self, _t: &mut T, p: *mut u8) {
  • replacement in sanakirja-core/src/lib.rs at line 435
    [5.192][6.346:401](),[6.346][6.346:401](),[6.401][4.119:153](),[4.153][6.438:485](),[6.438][6.438:485]()
    hasher.update(core::slice::from_raw_parts(
    self.data.add(8),
    PAGE_SIZE - 8,
    ));
    [5.192]
    [6.116]
    hasher.update(core::slice::from_raw_parts(self.data.add(8), PAGE_SIZE - 8));
  • replacement in sanakirja-core/src/lib.rs at line 480
    [6.2857][6.2857:2873]()
    type Error;
    [6.2857]
    [6.2873]
    type Error: core::fmt::Debug;
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 394
    [6.4585][6.0:23]()
    unsafe fn put_mut(
    [6.4585]
    [6.23]
    unsafe fn put_mut<T: AllocPage>(
    txn: &mut T,
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 404
    [6.180][6.180:239]()
    Leaf::alloc_write(page, k0, v0, 0, r, &mut n);
    [6.180]
    [6.239]
    Leaf::alloc_write(txn, page, k0, v0, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 406
    [6.256][6.256:319]()
    Internal::alloc_write(page, k0, v0, 0, r, &mut n);
    [6.256]
    [6.319]
    Internal::alloc_write(txn, page, k0, v0, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 711
    [6.17887][6.17887:17973]()
    fn alloc_write(new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize);
    [6.17887]
    [6.1207]
    fn alloc_write<T: AllocPage>(t: &mut T, new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 716
    [6.18046][2.0:128](),[2.128][6.19129:19142](),[6.2169][6.19129:19142](),[6.18136][6.19129:19142](),[6.19129][6.19129:19142]()
    fn modify<T: LoadPage, K: core::fmt::Debug + ?Sized, V: core::fmt::Debug + ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(
    txn: &T,
    [6.18046]
    [6.19142]
    fn modify<T: LoadPage + AllocPage, K: core::fmt::Debug + ?Sized, V: core::fmt::Debug + ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(
    txn: &mut T,
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 724
    [6.18399][6.18399:18443]()
    L::alloc_write(new, k, v, l, r, n);
    [6.18399]
    [6.19462]
    L::alloc_write(txn, new, k, v, l, r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 730
    [6.19558][3.23:73](),[3.73][6.136:188](),[6.136][6.136:188]()
    L::alloc_write(new, k, v, l, m.l, n);
    L::alloc_write(new, k2, v2, 0, m.r, n);
    [6.19558]
    [3.74]
    L::alloc_write(txn, new, k, v, l, m.l, n);
    L::alloc_write(txn, new, k2, v2, 0, m.r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 733
    [3.102][3.102:154]()
    L::alloc_write(new, k, v, m.l, m.r, n);
    [3.102]
    [6.19664]
    L::alloc_write(txn, new, k, v, m.l, m.r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 735
    [6.19681][3.155:205]()
    L::alloc_write(new, k, v, l, m.r, n);
    [6.19681]
    [6.19735]
    L::alloc_write(txn, new, k, v, l, m.r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 756
    [3.679][3.679:728]()
    L::alloc_write(new, k, v, l, rr, n);
    [3.679]
    [3.728]
    L::alloc_write(txn, new, k, v, l, rr, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 759
    [3.765][3.765:813]()
    L::alloc_write(new, k, v, l, r, n);
    [3.765]
    [3.813]
    L::alloc_write(txn, new, k, v, l, r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 799
    [6.19651][6.19651:19717]()
    L::alloc_write(&mut new, m.mid.0, m.mid.1, 0, l, &mut n);
    [6.19651]
    [6.19717]
    L::alloc_write(txn, &mut new, m.mid.0, m.mid.1, 0, l, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 801
    [6.19796][6.19796:19854]()
    L::alloc_write(&mut new, k, v, 0, r, &mut n);
    [6.19796]
    [6.20741]
    L::alloc_write(txn, &mut new, k, v, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 807
    [6.20041][6.20041:20099]()
    L::alloc_write(&mut new, k, v, l, r, &mut n);
    [6.20041]
    [6.21047]
    L::alloc_write(txn, &mut new, k, v, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 810
    [6.21076][6.20100:20166]()
    L::alloc_write(&mut new, m.mid.0, m.mid.1, 0, 0, &mut n);
    [6.21076]
    [6.20166]
    L::alloc_write(txn, &mut new, m.mid.0, m.mid.1, 0, 0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 77
    [6.27919][6.25391:25513]()
    L::alloc_write(&mut page, k0, v0, 0, 0, &mut n);
    L::alloc_write(&mut page, k1, v1, l, r, &mut n);
    [6.27919]
    [6.28045]
    L::alloc_write(txn, &mut page, k0, v0, 0, 0, &mut n);
    L::alloc_write(txn, &mut page, k1, v1, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 80
    [6.28062][6.25514:25575]()
    L::alloc_write(&mut page, k0, v0, l, r, &mut n);
    [6.28062]
    [6.28125]
    L::alloc_write(txn, &mut page, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 104
    [6.28669][6.26085:26205]()
    L::alloc_write(&mut new, k0, v0, 0, l, &mut n);
    L::alloc_write(&mut new, k1, v1, 0, r, &mut n);
    [6.28669]
    [6.28793]
    L::alloc_write(txn, &mut new, k0, v0, 0, l, &mut n);
    L::alloc_write(txn, &mut new, k1, v1, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 107
    [6.28810][6.26206:26266]()
    L::alloc_write(&mut new, k0, v0, l, r, &mut n);
    [6.28810]
    [6.28872]
    L::alloc_write(txn, &mut new, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 182
    [6.28252][6.28252:28321]()
    L::alloc_write(current_page, k0, v0, 0, l0, &mut n);
    [6.28252]
    [6.28321]
    L::alloc_write(txn, current_page, k0, v0, 0, l0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 184
    [6.28383][6.28383:28452]()
    L::alloc_write(current_page, k1, v1, 0, r0, &mut n);
    [6.28383]
    [6.28452]
    L::alloc_write(txn, current_page, k1, v1, 0, r0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 191
    [6.28624][6.28624:28694]()
    L::alloc_write(current_page, k0, v0, l0, r0, &mut n);
    [6.28624]
    [6.28694]
    L::alloc_write(txn, current_page, k0, v0, l0, r0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 265
    [6.928][6.31289:31419]()
    L::alloc_write(current_page, k0, v0, 0, l0, &mut n);
    L::alloc_write(current_page, k1, v1, 0, r0, &mut n);
    [6.928]
    [6.1062]
    L::alloc_write(txn, current_page, k0, v0, 0, l0, &mut n);
    L::alloc_write(txn, current_page, k1, v1, 0, r0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/put.rs at line 268
    [6.1079][6.31420:31486]()
    L::alloc_write(current_page, k0, v0, l0, r0, &mut n);
    [6.1079]
    [6.31734]
    L::alloc_write(txn, current_page, k0, v0, l0, r0, &mut n);
  • replacement in sanakirja-core/src/btree/page_unsized/alloc.rs at line 181
    [6.35490][6.35490:35633]()
    fn alloc_write(new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<K, V, Self>(new, k0, v0, l, r, n)
    [6.35490]
    [6.4978]
    fn alloc_write<T: AllocPage>(
    t: &mut T,
    new: &mut MutPage,
    k0: &K,
    v0: &V,
    l: u64,
    r: u64,
    n: &mut isize,
    ) {
    alloc_write::<T, K, V, Self>(t, new, k0, v0, l, r, n)
  • replacement in sanakirja-core/src/btree/page_unsized/alloc.rs at line 198
    [6.35737][6.35737:35880]()
    fn alloc_write(new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<K, V, Self>(new, k0, v0, l, r, n)
    [6.35737]
    [6.5080]
    fn alloc_write<T: AllocPage>(
    t: &mut T,
    new: &mut MutPage,
    k0: &K,
    v0: &V,
    l: u64,
    r: u64,
    n: &mut isize,
    ) {
    alloc_write::<T, K, V, Self>(t, new, k0, v0, l, r, n)
  • replacement in sanakirja-core/src/btree/page_unsized/alloc.rs at line 217
    [6.35950][6.35950:36034]()
    fn alloc_write<K: UnsizedStorable + ?Sized, V: UnsizedStorable + ?Sized, L: Alloc>(
    [6.35950]
    [6.36034]
    fn alloc_write<T: AllocPage, K: UnsizedStorable + ?Sized, V: UnsizedStorable + ?Sized, L: Alloc>(
    txn: &mut T,
  • replacement in sanakirja-core/src/btree/page_unsized/alloc.rs at line 230
    [6.36283][6.36283:36318]()
    k0.write_to_page(new_ptr);
    [6.36283]
    [6.36318]
    k0.write_to_page(txn, new_ptr);
  • replacement in sanakirja-core/src/btree/page_unsized/alloc.rs at line 233
    [6.36418][6.36418:36451]()
    v0.write_to_page(v_ptr);
    [6.36418]
    [6.36451]
    v0.write_to_page(txn, v_ptr);
  • replacement in sanakirja-core/src/btree/page.rs at line 339
    [6.11472][4.1213:1303]()
    unsafe fn put_mut(page: &mut MutPage, c: &mut Self::Cursor, k0: &K, v0: &V, r: u64) {
    [6.11472]
    [6.715]
    unsafe fn put_mut<T: AllocPage>(txn: &mut T, page: &mut MutPage, c: &mut Self::Cursor, k0: &K, v0: &V, r: u64) {
  • replacement in sanakirja-core/src/btree/page.rs at line 343
    [6.807][6.807:866]()
    Leaf::alloc_write(page, k0, v0, 0, r, &mut n);
    [6.807]
    [6.866]
    Leaf::alloc_write(txn, page, k0, v0, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page.rs at line 345
    [6.883][6.883:946]()
    Internal::alloc_write(page, k0, v0, 0, r, &mut n);
    [6.883]
    [6.946]
    Internal::alloc_write(txn, page, k0, v0, 0, r, &mut n);
  • replacement in sanakirja-core/src/btree/page/put.rs at line 43
    [6.39866][6.39866:39923]()
    L::alloc_write(&mut page, k0, v0, l, r, &mut n);
    [6.39866]
    [6.39923]
    L::alloc_write(txn, &mut page, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page/put.rs at line 63
    [6.10908][6.40338:40394]()
    L::alloc_write(&mut new, k0, v0, l, r, &mut n);
    [6.10908]
    [6.10977]
    L::alloc_write(txn, &mut new, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page/put.rs at line 141
    [6.11760][6.41486:41548]()
    L::alloc_write(&mut right, k0, v0, l, r, &mut n);
    [6.11760]
    [6.11824]
    L::alloc_write(txn, &mut right, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page/put.rs at line 197
    [6.12251][6.42422:42479]()
    L::alloc_write(&mut left, k0, v0, l, r, &mut n);
    [6.12251]
    [6.12252]
    L::alloc_write(txn, &mut left, k0, v0, l, r, &mut n);
  • replacement in sanakirja-core/src/btree/page/alloc.rs at line 306
    [6.43824][6.43824:43967]()
    fn alloc_write(new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<K, V, Self>(new, k0, v0, l, r, n)
    [6.43824]
    [6.6310]
    fn alloc_write<T: AllocPage>(t: &mut T, new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<T, K, V, Self>(t, new, k0, v0, l, r, n)
  • replacement in sanakirja-core/src/btree/page/alloc.rs at line 317
    [6.44063][6.44063:44206]()
    fn alloc_write(new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<K, V, Self>(new, k0, v0, l, r, n)
    [6.44063]
    [6.6461]
    fn alloc_write<T: AllocPage>(t: &mut T, new: &mut MutPage, k0: &K, v0: &V, l: u64, r: u64, n: &mut isize) {
    alloc_write::<T, K, V, Self>(t, new, k0, v0, l, r, n)
  • replacement in sanakirja-core/src/btree/page/alloc.rs at line 327
    [6.44307][6.44307:44359]()
    fn alloc_write<K: Storable, V: Storable, L: Alloc>(
    [6.44307]
    [6.44359]
    fn alloc_write<T: AllocPage, K: Storable, V: Storable, L: Alloc>(
    _t: &mut T,
  • replacement in sanakirja-core/src/btree/mod.rs at line 184
    [6.1408][6.1408:1431]()
    unsafe fn put_mut(
    [6.1408]
    [6.1431]
    unsafe fn put_mut<T: AllocPage>(
    txn: &mut T,