pub struct ArenaState { /* private fields */ }Expand description
Per-instance state backing the alloc/free/dispatch imports.
One ArenaState lives in each wasmtime Store’s payload (see
crate::instance::InstanceState). Because every host-import closure
reaches it through caller.data_mut() — an &mut borrow that wasmtime
guarantees is unique for the duration of the call — no synchronisation
wrapper is required, and crucially the arena is NOT shared across
instances that happen to share a Linker. Two tenants instantiated
from the same linker each get their own bump cursor and live stack.
Implementations§
Source§impl ArenaState
impl ArenaState
Sourcepub fn bump_cursor(&self) -> Option<u32>
pub fn bump_cursor(&self) -> Option<u32>
Current bump cursor, if any allocation has happened.
Exposed primarily for tests that need to assert per-store isolation.
Sourcepub fn live_count(&self) -> usize
pub fn live_count(&self) -> usize
Number of live (currently-allocated) slots on the LIFO stack.
Exposed primarily for tests.
Trait Implementations§
Source§impl Debug for ArenaState
impl Debug for ArenaState
Source§impl Default for ArenaState
impl Default for ArenaState
Source§fn default() -> ArenaState
fn default() -> ArenaState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArenaState
impl RefUnwindSafe for ArenaState
impl Send for ArenaState
impl Sync for ArenaState
impl Unpin for ArenaState
impl UnsafeUnpin for ArenaState
impl UnwindSafe for ArenaState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more