Trait sanakirja::AllocPage[][src]

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

Trait for allocating and freeing pages.

Required methods

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

Allocate a new page.

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

Increment the page’s reference count.

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

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

Loading content...

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.

Loading content...