aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorJesse Meyer <jesse.r.meyer@me.com>2026-02-03 20:52:52 -0500
committerGitHub <noreply@github.com>2026-02-03 20:52:52 -0500
commitb8276065f9296754d1e76e25d6661b7b5567e3e1 (patch)
tree7b8783d43193c16e4ef393a175fede50a8fe52dd /src/types.cpp
parentbd6148dd6b77920cf64fea8804b205e8257e8a66 (diff)
parent270df36468df8f89e1ac944205272469142c7a65 (diff)
Merge branch 'master' into lto-support
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/types.cpp b/src/types.cpp
index a7f2bfda2..0ecce1adc 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -170,21 +170,21 @@ struct TypeStruct {
};
struct TypeUnion {
- Slice<Type *> variants;
+ Slice<Type *> variants;
- Ast * node;
- Scope * scope;
+ Ast * node;
+ Scope * scope;
- i64 variant_block_size;
- i64 custom_align;
- Type * polymorphic_params; // Type_Tuple
- Type * polymorphic_parent;
- Wait_Signal polymorphic_wait_signal;
+ std::atomic<i64> variant_block_size;
+ i64 custom_align;
+ Type * polymorphic_params; // Type_Tuple
+ Type * polymorphic_parent;
+ Wait_Signal polymorphic_wait_signal;
- i16 tag_size;
- bool is_polymorphic;
- bool is_poly_specialized;
- UnionTypeKind kind;
+ std::atomic<i16> tag_size;
+ bool is_polymorphic;
+ bool is_poly_specialized;
+ UnionTypeKind kind;
};
struct TypeProc {
@@ -4308,17 +4308,17 @@ gb_internal i64 *type_set_offsets_of(Slice<Entity *> const &fields, bool is_pack
gb_internal bool type_set_offsets(Type *t) {
t = base_type(t);
if (t->kind == Type_Struct) {
- if (t->Struct.are_offsets_being_processed.load()) {
- return true;
- }
+ // if (t->Struct.are_offsets_being_processed.load()) {
+ // return true;
+ // }
MUTEX_GUARD(&t->Struct.offset_mutex);
if (!t->Struct.are_offsets_set) {
t->Struct.are_offsets_being_processed.store(true);
t->Struct.offsets = type_set_offsets_of(t->Struct.fields, t->Struct.is_packed, t->Struct.is_raw_union, t->Struct.custom_min_field_align, t->Struct.custom_max_field_align);
t->Struct.are_offsets_being_processed.store(false);
t->Struct.are_offsets_set = true;
- return true;
}
+ return true;
} else if (is_type_tuple(t)) {
MUTEX_GUARD(&t->Tuple.mutex);
if (!t->Tuple.are_offsets_set) {
@@ -4326,8 +4326,8 @@ gb_internal bool type_set_offsets(Type *t) {
t->Tuple.offsets = type_set_offsets_of(t->Tuple.variables, t->Tuple.is_packed, false, 1, 0);
t->Tuple.are_offsets_being_processed.store(false);
t->Tuple.are_offsets_set = true;
- return true;
}
+ return true;
} else {
GB_PANIC("Invalid type for setting offsets");
}