#[repr(C)]pub struct VMExternRefActivationsTable { /* private fields */ }
Expand description
A table that over-approximizes the set of VMExternRef
s 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
impl VMExternRefActivationsTable
sourcepub fn bump_capacity_remaining(&self) -> usize
pub fn bump_capacity_remaining(&self) -> usize
Get the available capacity in the bump allocation chunk.
sourcepub fn try_insert(&mut self, externref: VMExternRef) -> Result<(), VMExternRef>
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).
sourcepub unsafe fn insert_with_gc(
&mut self,
externref: VMExternRef,
module_info_lookup: &dyn ModuleInfoLookup
)
pub unsafe fn insert_with_gc( &mut self, 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
.
sourcepub fn insert_without_gc(&mut self, externref: VMExternRef)
pub fn insert_without_gc(&mut self, externref: VMExternRef)
Insert a reference into the table, without ever performing GC.
sourcepub fn set_gc_okay(&mut self, okay: bool) -> bool
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.