remove deallocating while lifting record and arrays

This commit is contained in:
vms 2021-03-12 22:08:17 +03:00
parent f6fdc50e75
commit 3f22999045
3 changed files with 0 additions and 39 deletions

View File

@ -181,8 +181,6 @@ where
}
};
deallocate(instance, instruction, offset as _, size as _)?;
Ok(result_array)
}

View File

@ -12,18 +12,6 @@ use crate::{
};
use std::convert::TryInto;
/*
struct Record1 {
field1: String,
field2: i32,
}
// export
fn foo(t: Record1) {
// import
*/
/*
/// Build an `IValue::Record` based on values on the stack.
@ -249,8 +237,6 @@ where
field_id += 1;
}
super::deallocate(instance, instruction, offset as _, size as _)?;
Ok(IValue::Record(
NEVec::new(values.into_iter().collect())
.expect("Record must have at least one field, zero given"),

View File

@ -130,29 +130,6 @@ where
to_native::<i32>(&values[0], instruction).map(|v| v as usize)
}
pub(super) fn deallocate<'instance, Instance, Export, LocalImport, Memory, MemoryView>(
instance: &'instance Instance,
instruction: Instruction,
mem_ptr: i32,
size: i32,
) -> Result<(), InstructionError>
where
Export: wasm::structures::Export + 'instance,
LocalImport: wasm::structures::LocalImport + 'instance,
Memory: wasm::structures::Memory<MemoryView> + 'instance,
MemoryView: wasm::structures::MemoryView,
Instance: wasm::structures::Instance<Export, LocalImport, Memory, MemoryView>,
{
let _ = call_core(
instance,
DEALLOCATE_FUNC_INDEX,
instruction,
vec![IValue::I32(mem_ptr), IValue::I32(size)],
)?;
Ok(())
}
fn call_core<'instance, Instance, Export, LocalImport, Memory, MemoryView>(
instance: &'instance Instance,
function_index: u32,