mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
rename type_code to type_tag
This commit is contained in:
parent
aa8ab1b1e3
commit
a48662d48c
@ -44,7 +44,7 @@ pub fn record_size(record_type: &IRecordType) -> usize {
|
||||
.sum()
|
||||
}
|
||||
|
||||
pub fn type_code_form_itype(itype: &IType) -> u32 {
|
||||
pub fn type_tag_form_itype(itype: &IType) -> u32 {
|
||||
const POINTER_CODE: u32 = 3; // u32 on the sdk
|
||||
|
||||
match itype {
|
||||
@ -63,7 +63,7 @@ pub fn type_code_form_itype(itype: &IType) -> u32 {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn type_code_form_ivalue(itype: &IValue) -> u32 {
|
||||
pub fn type_tag_form_ivalue(itype: &IValue) -> u32 {
|
||||
const POINTER_CODE: u32 = 3; // u32 on the sdk
|
||||
|
||||
match itype {
|
||||
|
@ -3,7 +3,7 @@ use super::lilo::*;
|
||||
use crate::IValue;
|
||||
|
||||
use it_lilo_utils::ser_value_size;
|
||||
use it_lilo_utils::type_code_form_ivalue;
|
||||
use it_lilo_utils::type_tag_form_ivalue;
|
||||
|
||||
pub(crate) fn array_lower_memory_impl(
|
||||
lo_helper: &LoHelper,
|
||||
@ -17,7 +17,7 @@ pub(crate) fn array_lower_memory_impl(
|
||||
let size_to_allocate = ser_value_size(&array_values[0]) * elements_count;
|
||||
let offset = (lo_helper.allocate)(
|
||||
size_to_allocate as _,
|
||||
type_code_form_ivalue(&array_values[0]) as _,
|
||||
type_tag_form_ivalue(&array_values[0]) as _,
|
||||
)?;
|
||||
|
||||
let seq_writer = lo_helper
|
||||
|
@ -5,7 +5,7 @@ use crate::interpreter::wasm;
|
||||
use crate::IType;
|
||||
|
||||
use it_lilo_utils::memory_writer::MemoryWriter;
|
||||
use it_lilo_utils::type_code_form_itype;
|
||||
use it_lilo_utils::type_tag_form_itype;
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
@ -35,8 +35,8 @@ impl<'instance> LoHelper<'instance> {
|
||||
}
|
||||
|
||||
pub(crate) fn write_to_mem(&self, bytes: &[u8]) -> LiLoResult<usize> {
|
||||
let alloc_type_code = type_code_form_itype(&IType::U8);
|
||||
let offset = (self.allocate)(bytes.len() as _, alloc_type_code as _)?;
|
||||
let alloc_type_tag = type_tag_form_itype(&IType::U8);
|
||||
let offset = (self.allocate)(bytes.len() as _, alloc_type_tag as _)?;
|
||||
|
||||
self.writer.write_bytes(offset, bytes)?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user