aboutsummaryrefslogtreecommitdiff
path: root/src/parser.hpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2026-02-02 10:46:57 +0000
committergingerBill <gingerBill@users.noreply.github.com>2026-02-02 10:48:30 +0000
commit2608f92fee1656ff11f4487667eb72df256eadc7 (patch)
tree3d057caaec0afe000c4110362e61ecca651407c2 /src/parser.hpp
parentf45ca2d03e46886d52641b6f40763e0c95ebc3c8 (diff)
Use `std::atomic` for `Ast.viral_state_flags` and `Ast_Ident.entity`
Diffstat (limited to 'src/parser.hpp')
-rw-r--r--src/parser.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/parser.hpp b/src/parser.hpp
index 39f56ffae..1026433d0 100644
--- a/src/parser.hpp
+++ b/src/parser.hpp
@@ -425,7 +425,7 @@ struct AstSplitArgs {
#define AST_KINDS \
AST_KIND(Ident, "identifier", struct { \
Token token; \
- Entity *entity; \
+ std::atomic<Entity *> entity; \
u32 hash; \
}) \
AST_KIND(Implicit, "implicit", Token) \
@@ -856,19 +856,19 @@ gb_global isize const ast_variant_sizes[] = {
};
struct AstCommonStuff {
- AstKind kind; // u16
- u8 state_flags;
- u8 viral_state_flags;
- i32 file_id;
- TypeAndValue tav; // NOTE(bill): Making this a pointer is slower
+ AstKind kind; // u16
+ u8 state_flags;
+ std::atomic<u8> viral_state_flags;
+ i32 file_id;
+ TypeAndValue tav; // NOTE(bill): Making this a pointer is slower
};
struct Ast {
- AstKind kind; // u16
- u8 state_flags;
- u8 viral_state_flags;
- i32 file_id;
- TypeAndValue tav; // NOTE(bill): Making this a pointer is slower
+ AstKind kind; // u16
+ u8 state_flags;
+ std::atomic<u8> viral_state_flags;
+ i32 file_id;
+ TypeAndValue tav; // NOTE(bill): Making this a pointer is slower
// IMPORTANT NOTE(bill): This must be at the end since the AST is allocated to be size of the variant
union {