switch to thread safe hash trie map

Initial implementation of the symbol table allowed us to push symbols
from one thread at a time and required a wonky lock-step and spread out
logic for replacing symbols. And because it was a externally chained
hash table we had to guesstimate optimal capacity for small and big targets.
We erred on the side of larger capacity to prevent degradation and
rehashing, however this meant small targets had to spent unreasonable
amount of time memory allocing slots. With hash trie we can dynamically
scale up to 4 ^ 32 items and atomically replace symbols when needed. Neat!
This commit is contained in:
Nikita Smith
2024-10-30 15:43:53 -07:00
parent ee65ea3692
commit 4a2e1dd8d0
14 changed files with 877 additions and 1049 deletions
+5 -3
View File
@@ -12,6 +12,7 @@ typedef struct LNK_Lib
U32 * member_off_arr;
String8List symbol_name_list;
String8 long_names;
U64 input_idx;
} LNK_Lib;
typedef struct LNK_LibNode
@@ -92,9 +93,10 @@ typedef struct LNK_LibBuild
typedef struct
{
LNK_LibNode *node_arr;
String8 *data_arr;
String8 *path_arr;
LNK_LibNode *node_arr;
String8 *data_arr;
String8 *path_arr;
U64 base_input_idx;
} LNK_LibIniter;
////////////////////////////////