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

@@ -170,8 +170,9 @@ gb_internal void override_entity_in_scope(Entity *original_entity, Entity *new_e
// Therefore two things can be done: the type can be assigned to state that it
// has been "evaluated" and the variant data can be copied across
u32 hash = string_hash(original_name);
rw_mutex_lock(&found_scope->mutex);
string_map_set(&found_scope->elements, original_name, new_entity);
scope_map_insert(&found_scope->elements, original_name, hash, new_entity);
rw_mutex_unlock(&found_scope->mutex);
original_entity->flags |= EntityFlag_Overridden;