mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Wasm: load platform object file in tests and pass the bytes to the backend
This commit is contained in:
parent
5d5e0eca96
commit
fd79613f0d
2 changed files with 20 additions and 5 deletions
|
@ -38,9 +38,10 @@ pub struct Env<'a> {
|
|||
pub fn build_module<'a>(
|
||||
env: &'a Env<'a>,
|
||||
interns: &'a mut Interns,
|
||||
platform_bytes: &[u8],
|
||||
procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
|
||||
) -> Result<std::vec::Vec<u8>, String> {
|
||||
let (wasm_module, _) = build_module_help(env, interns, procedures)?;
|
||||
let (wasm_module, _) = build_module_help(env, interns, platform_bytes, procedures)?;
|
||||
let mut buffer = std::vec::Vec::with_capacity(4096);
|
||||
wasm_module.serialize(&mut buffer);
|
||||
Ok(buffer)
|
||||
|
@ -49,6 +50,7 @@ pub fn build_module<'a>(
|
|||
pub fn build_module_help<'a>(
|
||||
env: &'a Env<'a>,
|
||||
interns: &'a mut Interns,
|
||||
platform_bytes: &[u8],
|
||||
procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
|
||||
) -> Result<(WasmModule<'a>, u32), String> {
|
||||
let mut layout_ids = LayoutIds::default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue