Begin minimize Type size by replacing Array with Slice etc

This commit is contained in:
gingerBill
2021-09-13 00:58:39 +01:00
parent 6585601765
commit fb8fa5217d
13 changed files with 147 additions and 110 deletions

View File

@@ -1670,7 +1670,7 @@ LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
LLVMTypeRef *fields = gb_alloc_array(permanent_allocator(), LLVMTypeRef, field_count);
i64 alignment = type_align_of(type);
unsigned size_of_union = cast(unsigned)type_size_of(type);
fields[0] = lb_alignment_prefix_type_hack(m, alignment);
fields[0] = lb_alignment_prefix_type_hack(m, gb_min(alignment, 16));
fields[1] = LLVMArrayType(lb_type(m, t_u8), size_of_union);
return LLVMStructTypeInContext(ctx, fields, field_count, false);
}