Cleanup, comments, renaming
[?]
Feb 14, 2021, 2:22 PM
CCNPHVQCIGINWTLXCHOASGVWUPBZXFOLM2F7HTKMEA2DMFTOX7TACDependencies
- [2]
QYDGYIZRSplit trait Representable into its mandatory part and an optional part - [3]
H3FVSQIQUnsized pages - [4]
OFINGD26implementing prev() on cursors (+ some cleanup) - [5]
RV2L6CZWA few comments - [6]
T73WR2BXCleaner RC increments for keys and values containing references + more comments in `del` - [7]
W26CFMAQImproving safety of cursors - [8]
G4JEQLLXDebugging synchronisation - [9]
HN6Z5DU4Cleanup - [10]
6DMPXOATMore debugging - [11]
UUUVNC4DDebugging/cleanup around cursors - [12]
NXMFNPZ7Comments + debugging drop - [13]
XEU2QVLCDebugging after plugging this into Pijul - [14]
OP6SVMODResetting history - [15]
OTWDDJE7Trait/type cleanup - [16]
WS4ZQM4RDebugging, tests, etc. - [17]
QEUTVAZ4Splitting btree::page - [18]
ESUI5EUZMaking as_page() unsafe - [19]
LSQ6V7M6Cleanup + docs - [20]
WAKPPBKOFixing a double-free of roots after deletions (the root was freed both by handle_merge and by update_root) - [21]
6UVFCERMFormatting, debugging, etc. - [22]
APPY2E7MUnsized deletions + custom sizes back - [23]
KMT3MF5NDrop a database
Change contents
- replacement in sanakirja-core/src/lib.rs at line 15
//! At the moment, only B trees are implemented, as well as three//! important traits://! At the moment, only B trees are implemented, as well as the//! following general traits: - edit in sanakirja-core/src/lib.rs at line 18
//! - [`Representable`] is the trait of types that can be written to//! disk and read from the disk. - edit in sanakirja-core/src/lib.rs at line 26
//!//! Moreover, two other traits can be used to store things on pages://! [`Storable`] is a simple trait that all `Sized + Ord` types//! without references can readily implement (the [`direct_repr!`]//! macro does that). For types containing references to pages//! allocated in the database, the comparison function can be//! customised. Moreover, these types must supply an iterator over//! these references, in order for reference-counting to work properly//! when the datastructures referencing these types are forked.//!//! Dynamically-sized types, or types that need to be represented in a//! dynamically-sized way, can use the [`UnsizedStorable`] format. - replacement in sanakirja-core/src/lib.rs at line 45
/// Types that can be stored on disk./// Types that can be stored on disk. This trait may be used in/// conjunction with `Sized` in order to determine the on-disk size,/// or with [`UnsizedStorable`] when special arrangements are needed. - replacement in sanakirja-core/src/lib.rs at line 57
fn page_offsets(&self) -> Self::PageOffsets;fn page_references(&self) -> Self::PageReferences; - replacement in sanakirja-core/src/lib.rs at line 63
type PageOffsets: Iterator<Item = u64>;type PageReferences: Iterator<Item = u64>; - replacement in sanakirja-core/src/lib.rs at line 66
/// A macro to implement [`Representable`] on "plain" types,/// A macro to implement [`Storable`] on "plain" types, - replacement in sanakirja-core/src/lib.rs at line 73
type PageOffsets = core::iter::Empty<u64>;fn page_offsets(&self) -> Self::PageOffsets {type PageReferences = core::iter::Empty<u64>;fn page_references(&self) -> Self::PageReferences { - replacement in sanakirja-core/src/lib.rs at line 139
type PageOffsets = core::iter::Empty<u64>;fn page_offsets(&self) -> Self::PageOffsets {type PageReferences = core::iter::Empty<u64>;fn page_references(&self) -> Self::PageReferences { - replacement in sanakirja-core/src/lib.rs at line 201
/// Representation of a mutable or shared page./// Representation of a mutable or shared page. This is an owned page/// (like `Vec` in Rust's std), but we do not know whether we can/// mutate it or not.////// The least-significant bit of the first byte of each page is 1 if/// and only if the page was allocated by the current transaction (and/// hence isn't visible to any other transaction, meaning we can write/// on it). - edit in sanakirja-core/src/lib.rs at line 216
/// Representation of a borrowed, or immutable page, like a slice in/// Rust. - edit in sanakirja-core/src/lib.rs at line 226
/// Borrows the page. - edit in sanakirja-core/src/lib.rs at line 231
}}pub fn null() -> Self {CowPage {data: core::ptr::null_mut(),offset: 0, - replacement in sanakirja-core/src/lib.rs at line 235
/// The layout of pages is as follows: the LSB of the first byte is/// "dirty"./// An owned page on which we can write. This is just a wrapper around/// `CowPage` to avoid checking the "dirty" bit at running time. - edit in sanakirja-core/src/lib.rs at line 247
/// Checks the dirty bit of a page. - replacement in sanakirja-core/src/lib.rs at line 253
/// Trait for loading a page and a root. Base trait to implement/// "storage engines" under Sanakirja./// Trait for loading a page. - replacement in sanakirja-core/src/lib.rs at line 258
/// RCfn rc(&self, off: u64) -> Result<u64, Self::Error>;/// Reference-counting. Since reference-counts are designed to be/// storable into B trees by external allocators, pages referenced/// once aren't stored, and hence are indistinguishable from pages/// that are never referenced. The default implementation returns/// 0.////// This has the extra benefit of requiring less disk space, and/// isn't more unsafe than storing the reference count, since we/// aren't supposed to hold a reference to a page with "logical/// RC" 0, so storing "1" for that page would be redundant anyway.fn rc(&self, _off: u64) -> Result<u64, Self::Error> {Ok(0)} - replacement in sanakirja-core/src/lib.rs at line 274
/// Trait for loading a page and a root. Base trait to implement/// "storage engines" under Sanakirja./// Trait for allocating and freeing pages. - edit in sanakirja-core/src/lib.rs at line 276
/// Allocate a new page. - replacement in sanakirja-core/src/lib.rs at line 278
// Returns the new RC./// Increment the page's reference count. - replacement in sanakirja-core/src/lib.rs at line 280
// Returns the new RC (0 if freed)./// Decrement the page's reference count, assuming the page was/// first allocated by another transaction. If the RC reaches 0,/// free the page. Must return the new RC (0 if freed). - replacement in sanakirja-core/src/lib.rs at line 284
// Returns the new RC (0 if freed)./// Same as [`decr_rc`], but for pages allocated by the current/// transaction. This is an important distinction, as pages/// allocated by the current transaction can be reused immediately/// after being freed. - replacement in sanakirja-core/src/btree/put.rs at line 221[3.3297]→[3.8397:8461](∅→∅),[3.1200]→[3.8397:8461](∅→∅),[3.264]→[3.8397:8461](∅→∅),[3.1215]→[3.8397:8461](∅→∅),[3.8397]→[3.8397:8461](∅→∅)
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/mod.rs at line 443
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 58
for o in delk.page_offsets().chain(delv.page_offsets()) {for o in delk.page_references().chain(delv.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 173
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 351
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 421[3.2310]→[3.37710:37796](∅→∅),[3.16957]→[3.37710:37796](∅→∅),[3.10492]→[3.37710:37796](∅→∅),[3.37710]→[3.37710:37796](∅→∅)
for o in split_key.page_offsets().chain(split_value.page_offsets()) {for o in split_key.page_references().chain(split_value.page_references()){ - replacement in sanakirja-core/src/btree/del.rs at line 457
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 482
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 491
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) { - replacement in sanakirja-core/src/btree/del.rs at line 581
for o in k.page_offsets().chain(v.page_offsets()) {for o in k.page_references().chain(v.page_references()) {