mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
remove deallocating while lifting record and arrays
This commit is contained in:
parent
f6fdc50e75
commit
3f22999045
@ -181,8 +181,6 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
deallocate(instance, instruction, offset as _, size as _)?;
|
||||
|
||||
Ok(result_array)
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user