Adding the RootPage trait to access the raw bytes of a root page (needed in libpijul)
Dependencies
- [2]
SYURNHHLAdding the `put_mut` and `set_left_child` methods - [3]
TJ2R4HAZAccessing the root pages (unsafely, of course) - [4]
YWFYZNLZCleanup + inter-process concurrency - [5]
E4MD6T3LProofreading and commenting of this crate (massive bug fixes included) - [6]
SO25TWFLA few features for integrating it into Pijul - [7]
OFINGD26implementing prev() on cursors (+ some cleanup) - [8]
OP6SVMODResetting history - [9]
W2MIZD5BSingle file databases + CRC for the root pages (checking the other pages makes everything very slow)
Change contents
- replacement in sanakirja/src/lib.rs at line 107
pub use environment::{Commit, Env, MutTxn, RootDb, Txn};pub use environment::{Commit, Env, MutTxn, RootDb, Txn, RootPage}; - edit in sanakirja/src/environment/muttxn.rs at line 619
impl<E: Borrow<Env>, T> RootPage for MutTxn<E, T> {unsafe fn root_page(&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 562
}/// Access the root page of a transaction.pub trait RootPage {/// The root page of this transaction.unsafe fn root_page(&self) -> &[u8; 4064]; - edit in sanakirja/src/environment/mod.rs at line 570
impl<E: Borrow<Env>> RootPage for Txn<E> {unsafe fn root_page(&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 630
/// 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])}