#[repr(C)]
pub struct VMExternRefActivationsTable { /* private fields */ }
Expand description

A table that over-approximizes the set of VMExternRefs that any Wasm activation on this thread is currently using.

Under the covers, this is a simple bump allocator that allows duplicate entries. Deduplication happens at GC time.

Implementations§

source§

impl VMExternRefActivationsTable

source

pub fn new() -> Self

Create a new VMExternRefActivationsTable.

source

pub fn bump_capacity_remaining(&self) -> usize

Get the available capacity in the bump allocation chunk.

source

pub fn try_insert(&mut self, externref: VMExternRef) -> Result<(), VMExternRef>

Try and insert a VMExternRef into this table.

This is a fast path that only succeeds when the bump chunk has the capacity for the requested insertion.

If the insertion fails, then the VMExternRef is given back. Callers may attempt a GC to free up space and try again, or may call insert_slow_path to infallibly insert the reference (potentially allocating additional space in the table to hold it).

source

pub unsafe fn insert_with_gc( &mut self, limits: *const VMRuntimeLimits, externref: VMExternRef, module_info_lookup: &dyn ModuleInfoLookup )

Insert a reference into the table, falling back on a GC to clear up space if the table is already full.

§Unsafety

The same as gc.

source

pub fn insert_without_gc(&mut self, externref: VMExternRef)

Insert a reference into the table, without ever performing GC.

source

pub fn set_gc_okay(&mut self, okay: bool) -> bool

Set whether it is okay to GC or not right now.

This is provided as a helper for enabling various debug-only assertions and checking places where the wasmtime-runtime user expects there not to be any GCs.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.