rename type_code to type_tag

This commit is contained in:
vms 2021-04-21 04:17:18 +03:00
parent aa8ab1b1e3
commit a48662d48c
3 changed files with 7 additions and 7 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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)?;