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

fn alloc_page(&mut self) -> Result<MutPage, Self::Error>[src]

Allocate a new page.

fn incr_rc(&mut self, off: u64) -> Result<usize, Self::Error>[src]

Increment the page’s reference count.

fn decr_rc(&mut self, off: u64) -> Result<usize, Self::Error>[src]

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

fn decr_rc_owned(&mut self, off: u64) -> Result<usize, Self::Error>[src]

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

impl<E: Borrow<Env>, T> AllocPage for MutTxn<E, T>[src]

fn alloc_page(&mut self) -> Result<MutPage, Error>[src]

Allocate a single page.

fn incr_rc(&mut self, off: u64) -> Result<usize, Error>[src]

Increment the reference count for page off.

fn decr_rc(&mut self, off: u64) -> Result<usize, Error>[src]

fn decr_rc_owned(&mut self, off: u64) -> Result<usize, Error>[src]