wasmtime_environ/gc/
drc.rs1use super::*;
4
5pub const HEADER_SIZE: u32 = 24;
7
8pub const HEADER_ALIGN: u32 = 8;
10
11pub const ARRAY_LENGTH_OFFSET: u32 = HEADER_SIZE;
13
14pub const HEADER_MARK_BIT: u32 = 1 << 0;
18
19pub const HEADER_IN_OVER_APPROX_LIST_BIT: u32 = 1 << 1;
22
23#[derive(Default)]
25pub struct DrcTypeLayouts;
26
27impl GcTypeLayouts for DrcTypeLayouts {
28 fn array_length_field_offset(&self) -> u32 {
29 ARRAY_LENGTH_OFFSET
30 }
31
32 fn array_layout(&self, ty: &WasmArrayType) -> GcArrayLayout {
33 common_array_layout(ty, HEADER_SIZE, HEADER_ALIGN, ARRAY_LENGTH_OFFSET)
34 }
35
36 fn struct_layout(&self, ty: &WasmStructType) -> GcStructLayout {
37 common_struct_layout(ty, HEADER_SIZE, HEADER_ALIGN)
38 }
39}