Trait sanakirja::AllocPage[][src]

pub trait AllocPage: LoadPage {
    fn alloc_page(&mut self) -> Result<MutPage, Self::Error>;
fn incr_rc(&mut self, off: u64) -> Result<usize, Self::Error>;
fn decr_rc(&mut self, off: u64) -> Result<usize, Self::Error>;
fn decr_rc_owned(&mut self, off: u64) -> Result<usize, Self::Error>; }
Expand description

Trait for allocating and freeing pages.

Required methods

Allocate a new page.

Increment the page’s reference count.

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).

Same as Self::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.

Implementors