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

Function serialize

examples/serialize.cc:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28std::vector<uint8_t> serialize() {
29 std::cout << "Initializing...\n";
30 Engine engine;
31
32 std::cout << "Compiling module...\n";
33 auto wat = readFile("examples/hello.wat");
34 Module module = Module::compile(engine, wat).unwrap();
35
36 auto serialized = module.serialize().unwrap();
37
38 std::cout << "Serialized.\n";
39 return serialized;
40}
41
42void deserialize(std::vector<uint8_t> buffer) {
43 std::cout << "Initializing...\n";

Callers 1

mainFunction · 0.70

Calls 4

readFileFunction · 0.70
compileFunction · 0.50
unwrapMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected