mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-25 23:14:59 -07:00
Merge branch 'haiku' of https://github.com/avanspector/Odin into haiku
This commit is contained in:
@@ -2719,6 +2719,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
|
||||
{ // Type info member buffer
|
||||
// NOTE(bill): Removes need for heap allocation by making it global memory
|
||||
isize count = 0;
|
||||
isize offsets_extra = 0;
|
||||
|
||||
for (Type *t : m->info->type_info_types) {
|
||||
isize index = lb_type_info_index(m->info, t, false);
|
||||
@@ -2736,6 +2737,11 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
|
||||
case Type_Tuple:
|
||||
count += t->Tuple.variables.count;
|
||||
break;
|
||||
case Type_BitField:
|
||||
count += t->BitField.fields.count;
|
||||
// Twice is needed for the bit_offsets
|
||||
offsets_extra += t->BitField.fields.count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2752,7 +2758,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
|
||||
|
||||
lb_global_type_info_member_types = global_type_info_make(m, LB_TYPE_INFO_TYPES_NAME, t_type_info_ptr, count);
|
||||
lb_global_type_info_member_names = global_type_info_make(m, LB_TYPE_INFO_NAMES_NAME, t_string, count);
|
||||
lb_global_type_info_member_offsets = global_type_info_make(m, LB_TYPE_INFO_OFFSETS_NAME, t_uintptr, count);
|
||||
lb_global_type_info_member_offsets = global_type_info_make(m, LB_TYPE_INFO_OFFSETS_NAME, t_uintptr, count+offsets_extra);
|
||||
lb_global_type_info_member_usings = global_type_info_make(m, LB_TYPE_INFO_USINGS_NAME, t_bool, count);
|
||||
lb_global_type_info_member_tags = global_type_info_make(m, LB_TYPE_INFO_TAGS_NAME, t_string, count);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user