Skip to main content

add_jit_dispatch_to_linker

Function add_jit_dispatch_to_linker 

Source
pub fn add_jit_dispatch_to_linker<T>(
    linker: &mut Linker<T>,
    cache: Arc<KernelCache>,
) -> Result<()>
where T: JitArenaProvider + TenantContext + 'static,
Expand description

Register the tensor-wasm:jit/host::dispatch, alloc, and free imports on linker.

The cache handle is cloned into each closure so the same backing store is consulted by every guest instance the linker instantiates — kernel caching IS designed to be cross-tenant. The bump arena, in contrast, lives in the per-store payload T (via JitArenaProvider) so two instances sharing a Linker do NOT see each other’s cursor or live stack.