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

Function serialize_compiled

cranelift/codegen/src/incremental_cache.rs:194–203  ·  view source on GitHub ↗

Given a function that's been successfully compiled, serialize it to a blob that the caller may store somewhere for future use by `try_finish_recompile`. As this function requires ownership on the `CompiledCodeStencil`, it gives it back at the end of the function call. The value is left untouched.

(
    result: CompiledCodeStencil,
)

Source from the content-addressed store, hash-verified

192/// As this function requires ownership on the `CompiledCodeStencil`, it gives it back at the end
193/// of the function call. The value is left untouched.
194pub fn serialize_compiled(
195 result: CompiledCodeStencil,
196) -> (CompiledCodeStencil, Result<Vec<u8>, postcard::Error>) {
197 let cached = CachedFunc {
198 version_marker: VersionMarker,
199 stencil: result,
200 };
201 let result = postcard::to_allocvec(&cached);
202 (cached.stencil, result)
203}
204
205/// An error returned when recompiling failed.
206#[derive(Debug)]

Callers 1

compile_with_cacheMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected