pijul nest
guest [sign in]

Accessing the root pages (unsafely, of course)

[?]
Jun 2, 2021, 8:42 AM
TJ2R4HAZ23H3NW7CJSBXLLXUNPLK25XX33CLOL74NWO32JCG4UZQC

Dependencies

  • [2] 2ZRCQBXP Version bump
  • [3] YXKP4AIW New file locks, with multiple sets of free pages
  • [4] PRDUE4YA Cleanup + published on crates.io
  • [5] OHUZ73MK Versions
  • [6] E4MD6T3L Proofreading and commenting of this crate (massive bug fixes included)
  • [7] M6PHQUGL fallocate only when necessary
  • [8] DASFQGOR Debugging
  • [9] OP6SVMOD Resetting history
  • [10] 5LSYTRQ6 More docs, example, and fixing the free page diagnostic function for mutable transactions
  • [11] WTXLZDYI Fixing bus errors on a full disk
  • [*] OFINGD26 implementing prev() on cursors (+ some cleanup)

Change contents

  • edit in sanakirja/src/environment/muttxn.rs at line 568
    [3.90730]
    [3.90730]
    /// The root page of this transaction (use with caution, this page
    /// contains root databases).
    pub unsafe fn root_page_mut(&mut self) -> &mut [u8; 4064] {
    let env = self.env.borrow();
    let maps = env.mmaps.lock();
    let ptr = maps[0].ptr.add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE);
    &mut *(ptr as *mut [u8; 4064])
    }
    /// The root page of this transaction.
    pub unsafe fn root_page(&mut self) -> &[u8; 4064] {
    let env = self.env.borrow();
    let maps = env.mmaps.lock();
    let ptr = maps[0].ptr.add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE);
    &*(ptr as *const [u8; 4064])
    }
  • edit in sanakirja/src/environment/mod.rs at line 606
    [13.18035]
    [13.18035]
    }
    /// The root page of this transaction.
    pub unsafe fn root_page(&mut self) -> &[u8; 4064] {
    let env = self.env.borrow();
    let maps = env.mmaps.lock();
    let ptr = maps[0].ptr.add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE);
    &*(ptr as *const [u8; 4064])
  • replacement in sanakirja/Cargo.toml at line 3
    [3.108441][2.19:37]()
    version = "1.2.0"
    [3.108441]
    [3.108459]
    version = "1.2.1"
  • replacement in sanakirja/Cargo.toml at line 29
    [3.84][2.38:105]()
    sanakirja-core = { path = "../sanakirja-core", version = "1.2.0" }
    [3.84]
    [3.5528]
    sanakirja-core = { path = "../sanakirja-core", version = "1.2.8" }