WIP move export and import table make code to appropriate layers

This commit is contained in:
Nikita Smith
2025-06-25 10:53:22 -07:00
committed by Ryan Fleury
parent 69d5010245
commit f467ff8822
27 changed files with 992 additions and 1040 deletions
+13
View File
@@ -329,6 +329,19 @@ keys_from_hash_table_u64(Arena *arena, HashTable *ht)
return result;
}
internal String8 *
keys_from_hash_table_string(Arena *arena, HashTable *ht)
{
String8 *result = push_array_no_zero(arena, String8, ht->count);
for (U64 bucket_idx = 0, cursor = 0; bucket_idx < ht->cap; ++bucket_idx) {
for (BucketNode *n = ht->buckets[bucket_idx].first; n != 0; n = n->next) {
Assert(cursor < ht->count);
result[cursor++] = n->v.key_string;
}
}
return result;
}
internal KeyValuePair *
key_value_pairs_from_hash_table(Arena *arena, HashTable *ht)
{