MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / load_code_bytes

Method load_code_bytes

crates/wasmtime/src/engine.rs:883–895  ·  view source on GitHub ↗

Loads a `CodeMemory` from the specified in-memory slice, copying it to a uniquely owned mmap. The `expected` marker here is whether the bytes are expected to be a precompiled module or a component.

(
        &self,
        bytes: &[u8],
        expected: ObjectKind,
    )

Source from the content-addressed store, hash-verified

881 /// The `expected` marker here is whether the bytes are expected to be a
882 /// precompiled module or a component.
883 pub(crate) fn load_code_bytes(
884 &self,
885 bytes: &[u8],
886 expected: ObjectKind,
887 ) -> Result<Arc<crate::CodeMemory>> {
888 self.load_code(
889 crate::runtime::vm::MmapVec::from_slice_with_alignment(
890 bytes,
891 self.required_code_alignment(),
892 )?,
893 expected,
894 )
895 }
896
897 /// Loads a `CodeMemory` from the specified memory region without copying
898 ///

Callers 3

compile_cachedMethod · 0.80
deserializeMethod · 0.80
deserializeMethod · 0.80

Calls 2

load_codeMethod · 0.80

Tested by

no test coverage detected