Make TypeStructl.tags a pointer from a slice (reduce memory usage)

This commit is contained in:
gingerBill
2021-09-13 01:23:37 +01:00
parent 31ed4f15a8
commit 2d7aea79b9
4 changed files with 10 additions and 18 deletions

View File

@@ -130,7 +130,7 @@ enum StructSoaKind : u8 {
struct TypeStruct {
Slice<Entity *> fields;
Slice<String> tags;
String * tags; // count == fields.count
i64 * offsets; // count == fields.count
Ast * node;
@@ -140,7 +140,6 @@ struct TypeStruct {
Type * polymorphic_params; // Type_Tuple
Type * polymorphic_parent;
Type * soa_elem;
i32 soa_count;
StructSoaKind soa_kind;
@@ -2174,12 +2173,6 @@ bool are_types_identical(Type *x, Type *y) {
if (xf_is_using ^ yf_is_using) {
return false;
}
if (x->Struct.tags.count != y->Struct.tags.count) {
return false;
}
if (x->Struct.tags.count > 0 && x->Struct.tags[i] != y->Struct.tags[i]) {
return false;
}
}
return true;
}