replace single-hop associative section walk to multi-hop

This commit is contained in:
Nikita Smith committed 2026-05-18 18:11:48 -07:00
1 parent 921030c432
commit 1dc72b2bcf
10 files changed
+343 -234

No files matched your search

+19
View File
@@ -725,6 +725,18 @@ hash_map_push_u64_u64(Arena *arena, HashMap *hm, U64 key, U64 value)
return hash_map_push(arena, hm, hash_map_hasher(str8_struct(&key)), (HashMapKeyValue){ .key = { .key_u64 = key }, .value = { .value_u64 = value } }, hash_map_match_u64);
}
internal HashMapNode *
hash_map_push_raw_raw(Arena *arena, HashMap *hm, void *key, void *value)
{
return hash_map_push(arena, hm, hash_map_hasher(str8_struct(&key)), (HashMapKeyValue){ .key = { .key_raw = key }, .value = { .value_raw = value } }, hash_map_match_raw);
}
internal HashMapNode *
hash_map_push_raw_u64(Arena *arena, HashMap *hm, void *key, U64 value)
{
return hash_map_push(arena, hm, hash_map_hasher(str8_struct(&key)), (HashMapKeyValue){ .key = { .key_raw = key }, .value = { .value_u64 = value } }, hash_map_match_u64);
}
internal HashMapNode *
hash_map_push_path_u64(Arena *arena, HashMap *hm, String8 path, U64 value)
{
@@ -794,6 +806,13 @@ hash_map_search_raw_raw(HashMap *hm, void *key)
return n ? n->v.value.value_raw : 0;
}
internal U64 *
hash_map_search_raw_u64(HashMap *hm, void *key)
{
HashMapNode *n = hash_map_search(hm, hash_map_hasher(str8_struct(&key)), (HashMapKey){ .key_raw = key }, hash_map_match_raw);
return n ? &n->v.value.value_u64 : 0;
}
////////////////////////////////
internal B32 hash_map_purge_u32(HashMap *hm, U32 key) { return hash_map_purge_item(hm, hash_map_hasher(str8_struct(&key)), (HashMapKey){ .key_u32 = key }, hash_map_match_u32); }