implement upkr unpacker in wasm, use to load compressed base

This commit is contained in:
2021-11-20 23:36:16 +01:00
parent f7e3202c39
commit 93b2bb60bd
6 changed files with 149 additions and 19 deletions

View File

@@ -192,6 +192,13 @@ impl BaseModule {
File::create(path)?.write_all(&self.to_wasm())?;
Ok(())
}
pub fn create_binary(path: &Path) -> Result<()> {
let base1 = BaseModule::for_format_version(1)?.to_wasm();
let data = upkr::pack(&base1);
File::create(path)?.write_all(&data)?;
Ok(())
}
}
fn add_function(