Skip to main content

Memory

Trait Memory 

Source
pub trait Memory: View {
    // Required methods
    fn store(&self, address: u64, value: u64);
    fn release(&self, address: u64, value: u64);
    fn cas(&self, address: u64, old: u64, new: u64) -> u64;
    fn add(&self, address: u64, value: u64);
    fn repeat(&self, limit: u32, body: impl FnMut() -> bool) -> bool;

    // Provided methods
    fn store_word(&self, base: u64, word: u64, value: u64) { ... }
    fn corrupt(&self) { ... }
}
Expand description

Word access to queues and tasks.

Required Methods§

Source

fn store(&self, address: u64, value: u64)

Store value to the word at address.

Source

fn release(&self, address: u64, value: u64)

Store with release ordering.

Source

fn cas(&self, address: u64, old: u64, new: u64) -> u64

Compare and exchange, returning the previous value.

Source

fn add(&self, address: u64, value: u64)

Atomically add a nonzero value, discarding the result.

Source

fn repeat(&self, limit: u32, body: impl FnMut() -> bool) -> bool

Run body until it returns false, at most limit times. Returns whether it stopped by itself.

Provided Methods§

Source

fn store_word(&self, base: u64, word: u64, value: u64)

Store to the word at word of base, see View::load_word.

Source

fn corrupt(&self)

The tree and a membership disagree, a corruption rather than a race.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Memory> Memory for &T

Source§

fn store(&self, address: u64, value: u64)

Source§

fn release(&self, address: u64, value: u64)

Source§

fn cas(&self, address: u64, old: u64, new: u64) -> u64

Source§

fn add(&self, address: u64, value: u64)

Source§

fn repeat(&self, limit: u32, body: impl FnMut() -> bool) -> bool

Source§

fn corrupt(&self)

Implementors§