serialize method

Uint8List serialize()

Serialises the compiled artifact so it can be loaded again without recompiling (~WebAssembly.Module caching).

The blob is only valid for the exact wasmtime build and the same engine configuration.

Implementation

Uint8List serialize() => scoped((arena) {
  final out = arena<c.wasm_byte_vec_t>();
  throwIfError(c.wasmtime_module_serialize(pointer, out));
  return byteVecTake(out);
});