Commit 9f4bc558 authored by qinsoon's avatar qinsoon

fix

parent f3f82554
Pipeline #1302 failed with stages
in 18 minutes and 45 seconds
......@@ -477,6 +477,29 @@ impl MuType {
_ => None
}
}
/// prints a struct type
pub fn print_details(&self) -> String {
match self.v {
MuType_::Struct(ref tag) => {
let lock = STRUCT_TAG_MAP.read().unwrap();
format!("{} = {}", tag, lock.get(tag).unwrap())
}
MuType_::Hybrid(ref tag) => {
let lock = HYBRID_TAG_MAP.read().unwrap();
format!("{} = {}", tag, lock.get(tag).unwrap())
}
_ => format!("{}", self)
}
}
/// prints a struct type
pub fn print_hybrid(&self) -> String {
match self.v {
_ => panic!()
}
}
}
pub type StructTag = MuName;
......
......@@ -223,7 +223,8 @@ rodal_struct!(BackendType {
alignment,
struct_layout,
elem_size,
gc_type
gc_type,
gc_type_hybrid_full
});
impl BackendType {
......
......@@ -46,6 +46,7 @@ pub struct GlobalTypeTable {
const SMALL_ENTRY_CAP: usize = 1 << SMALL_ID_WIDTH;
const LARGE_ENTRY_CAP: usize = N_TYPES;
const FULL_ENTRY_START: usize = LARGE_ENTRY_CAP + 1;
/// storing a pointer to the actual type table
static GLOBAL_TYPE_TABLE_PTR: AtomicUsize = ATOMIC_USIZE_INIT;
......@@ -75,7 +76,7 @@ impl GlobalTypeTable {
// initialize meta
meta.small_entry_i = 0;
meta.large_entry_i = SMALL_ENTRY_CAP;
meta.full_entry_i = 0;
meta.full_entry_i = FULL_ENTRY_START;
unsafe {
use std::ptr;
ptr::write(
......
......@@ -67,7 +67,7 @@ pub fn gen_object_encode_internal(
let size = math::align_up(size, POINTER_SIZE);
if size <= MAX_TINY_OBJECT {
if !is_hybrid {
let size = if size < 16 {
let size = if size <= 16 {
16
} else {
assert!(size <= 24);
......@@ -107,6 +107,7 @@ pub fn gen_object_encode_internal(
}
}
#[no_mangle]
pub extern "C" fn muentry_alloc_var_size(
fix_size: ByteSize,
var_size: ByteSize,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment