Minor changes

This commit is contained in:
gingerBill
2026-03-17 08:10:13 +00:00
parent cb7a87773b
commit f7ede8632f
3 changed files with 14 additions and 7 deletions

View File

@@ -789,10 +789,10 @@ gb_internal bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us,
defer (rw_mutex_unlock(&scope->mutex));
for (auto const &entry : scope->elements) {
String name = scope->elements.keys[entry.hash & (scope->elements.cap-1)];
u32 hash = entry.hash;
Entity *decl = entry.value;
if (!is_entity_exported(decl, true)) continue;
String name = scope->elements.keys[entry.hash & (scope->elements.cap-1)];
u32 hash = entry.hash;
Entity *found = scope_insert_with_name(ctx->scope, name, hash, decl);
if (found != nullptr) {

View File

@@ -278,10 +278,10 @@ struct ScopeMapSlot {
enum { SCOPE_MAP_INLINE_CAP = 16 };
struct ScopeMap {
String inline_keys [SCOPE_MAP_INLINE_CAP];
ScopeMapSlot inline_slots[SCOPE_MAP_INLINE_CAP];
String inline_keys[SCOPE_MAP_INLINE_CAP];
ScopeMapSlot *slots;
String * keys;
ScopeMapSlot *slots;
u32 count;
u32 cap;
};

View File

@@ -978,7 +978,6 @@ gb_internal void set_base_type(Type *t, Type *base) {
gb_internal Type *alloc_type(TypeKind kind) {
// gbAllocator a = heap_allocator();
Type *t = permanent_alloc_item<Type>();
t->kind = kind;
t->cached_size = -1;
@@ -1139,8 +1138,8 @@ gb_internal Type *alloc_type_union() {
gb_internal Type *alloc_type_enum() {
Type *t = alloc_type(Type_Enum);
t->Enum.min_value = gb_alloc_item(permanent_allocator(), ExactValue);
t->Enum.max_value = gb_alloc_item(permanent_allocator(), ExactValue);
t->Enum.min_value = permanent_alloc_item<ExactValue>();
t->Enum.max_value = permanent_alloc_item<ExactValue>();
return t;
}
@@ -3049,6 +3048,10 @@ gb_internal bool are_types_identical_unique_tuples(Type *x, Type *y) {
return false;
}
if (x->canonical_hash && y->canonical_hash && x->canonical_hash != y->canonical_hash) {
return false;
}
// MUTEX_GUARD(&g_type_mutex);
return are_types_identical_internal(x, y, true);
}
@@ -3063,6 +3066,10 @@ gb_internal bool are_types_identical_internal(Type *x, Type *y, bool check_tuple
return false;
}
if (x->canonical_hash && y->canonical_hash && x->canonical_hash != y->canonical_hash) {
return false;
}
#if 0
if (x->kind == Type_Named) {
Entity *e = x->Named.type_name;