add assignment operator and unify memory pools
The unification of memory pools also fixed some memory leaks and hopefully reduced the mallocs of identifier strings significantly by giving them the same pool as the token stream.
This commit is contained in:
2
map.c
2
map.c
@@ -85,7 +85,7 @@ bool map_insert(Map *m, const char *key, const void *val) {
|
||||
return replaced;
|
||||
}
|
||||
|
||||
bool map_get(Map *m, const char *key, void *out_val) {
|
||||
bool map_get(const Map *m, const char *key, void *out_val) {
|
||||
size_t idx = fnv1a32(key, strlen(key)) & (m->cap - 1);
|
||||
for (;;) {
|
||||
if (m->slots[idx].empty)
|
||||
|
||||
Reference in New Issue
Block a user