Replace Scope.elements to use a custom hash map ScopeMap

This hash map is robin hood based with a inline slot amount for small scopes
This commit is contained in:
gingerBill
2026-03-16 17:41:58 +00:00
parent 1744f57d01
commit 36d5a19115
10 changed files with 374 additions and 81 deletions

View File

@@ -790,10 +790,11 @@ gb_internal bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us,
for (auto const &entry : scope->elements) {
String name = entry.key;
u32 hash = entry.hash;
Entity *decl = entry.value;
if (!is_entity_exported(decl, true)) continue;
Entity *found = scope_insert_with_name(ctx->scope, name, decl);
Entity *found = scope_insert_with_name(ctx->scope, name, hash, decl);
if (found != nullptr) {
gbString expr_str = expr_to_string(expr);
error(us->token,