pijul nest
guest [sign in]

fallocate only when necessary

[?]
Mar 7, 2021, 4:28 PM
M6PHQUGLW2UN6LIVF4NCPNBFBMALVCPZFQ2AYZGYHSOKO3RXWG2AC

Dependencies

  • [2] WTXLZDYI Fixing bus errors on a full disk
  • [3] OHUZ73MK Versions
  • [4] 5LSYTRQ6 More docs, example, and fixing the free page diagnostic function for mutable transactions
  • [5] DASFQGOR Debugging
  • [6] OFINGD26 implementing prev() on cursors (+ some cleanup)
  • [7] 6UVFCERM Formatting, debugging, etc.
  • [8] 52X5P7ND Cleaning up the unsized part
  • [9] OP6SVMOD Resetting history
  • [10] H3FVSQIQ Unsized pages
  • [*] W2MIZD5B Single file databases + CRC for the root pages (checking the other pages makes everything very slow)

Change contents

  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 636
    [3.18046][3.18046:18136]()
    fn modify<T: LoadPage, K: ?Sized, V: ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(
    [3.18046]
    [3.19129]
    fn modify<T: LoadPage, K: core::fmt::Debug + ?Sized, V: core::fmt::Debug + ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 677
    [3.18910][3.18910:18940]()
    K: ?Sized,
    V: ?Sized,
    [3.18910]
    [3.18940]
    K: ?Sized + core::fmt::Debug,
    V: ?Sized + core::fmt::Debug,
  • edit in sanakirja/src/environment/mod.rs at line 321
    [12.5468]
    [12.5468]
    fallocate(file, offset + length)?;
  • edit in sanakirja/src/environment/mod.rs at line 340
    [3.103972][2.728:913]()
    }
    }
    #[cfg(feature = "mmap")]
    fn fallocate(&self, length: u64) -> Result<(), Error> {
    if let Some(ref file) = self.file {
    file.allocate(length)?
  • edit in sanakirja/src/environment/mod.rs at line 341
    [3.103982][2.914:1045]()
    Ok(())
    }
    #[cfg(not(feature = "mmap"))]
    fn fallocate(&self, length: u64) -> Result<(), Error> {
    Ok(())
  • edit in sanakirja/src/environment/mod.rs at line 349
    [3.104118][2.1125:1173]()
    self.fallocate(offset + PAGE_SIZEU64)?;
  • replacement in sanakirja/src/environment/mod.rs at line 353
    [3.20369][3.104214:104279](),[3.104214][3.104214:104279]()
    mmaps.push(self.open_mmap(i, length0).unwrap());
    [3.20369]
    [3.104279]
    mmaps.push(self.open_mmap(i, length0)?);
  • edit in sanakirja/src/environment/mod.rs at line 391
    [3.105581]
    [12.5678]
    }
    #[cfg(feature = "mmap")]
    fn fallocate(file: &std::fs::File, length: u64) -> Result<(), Error> {
    file.allocate(length)?;
    Ok(())
  • edit in sanakirja/src/environment/mod.rs at line 399
    [12.5681]
    [12.5681]
    #[cfg(not(feature = "mmap"))]
    fn fallocate(&self, length: u64) -> Result<(), Error> {
    Ok(())
    }
  • replacement in sanakirja/Cargo.toml at line 3
    [3.108441][2.1298:1316]()
    version = "1.1.6"
    [3.108441]
    [3.108459]
    version = "1.1.7"