mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Make flags atomic for Entity and Type
This commit is contained in:
+1
-1
@@ -923,7 +923,7 @@ bool is_polymorphic_type_assignable(CheckerContext *c, Type *poly, Type *source,
|
|||||||
poly->kind = Type_EnumeratedArray;
|
poly->kind = Type_EnumeratedArray;
|
||||||
poly->cached_size = -1;
|
poly->cached_size = -1;
|
||||||
poly->cached_align = -1;
|
poly->cached_align = -1;
|
||||||
poly->flags = source->flags;
|
poly->flags.exchange(source->flags);
|
||||||
poly->failure = false;
|
poly->failure = false;
|
||||||
poly->EnumeratedArray.elem = source->EnumeratedArray.elem;
|
poly->EnumeratedArray.elem = source->EnumeratedArray.elem;
|
||||||
poly->EnumeratedArray.index = source->EnumeratedArray.index;
|
poly->EnumeratedArray.index = source->EnumeratedArray.index;
|
||||||
|
|||||||
+2
-2
@@ -115,8 +115,8 @@ enum ProcedureOptimizationMode : u32 {
|
|||||||
struct Entity {
|
struct Entity {
|
||||||
EntityKind kind;
|
EntityKind kind;
|
||||||
u64 id;
|
u64 id;
|
||||||
u64 flags;
|
std::atomic<u64> flags;
|
||||||
EntityState state;
|
std::atomic<EntityState> state;
|
||||||
Token token;
|
Token token;
|
||||||
Scope * scope;
|
Scope * scope;
|
||||||
Type * type;
|
Type * type;
|
||||||
|
|||||||
+3
-3
@@ -306,9 +306,9 @@ struct Type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// NOTE(bill): These need to be at the end to not affect the unionized data
|
// NOTE(bill): These need to be at the end to not affect the unionized data
|
||||||
i64 cached_size;
|
std::atomic<i64> cached_size;
|
||||||
i64 cached_align;
|
std::atomic<i64> cached_align;
|
||||||
u32 flags; // TypeFlag
|
std::atomic<u32> flags; // TypeFlag
|
||||||
bool failure;
|
bool failure;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user