BlockArena, a bit of allocator rework

This commit is contained in:
Krzosa Karol
2025-11-30 19:54:46 +01:00
parent c19c60fe22
commit c2f4686bc4
15 changed files with 337 additions and 224 deletions
+6 -3
View File
@@ -51,7 +51,9 @@ struct HashTable {
Assert(!(old_values == 0 && len != 0));
if (len == 0) {
if (old_values) Dealloc(allocator, &old_values);
if (old_values) {
Dealloc(allocator, old_values);
}
return;
}
@@ -62,7 +64,7 @@ struct HashTable {
insert(it->key, it->value);
}
}
Dealloc(allocator, &old_values);
Dealloc(allocator, old_values);
}
Entry *get_table_entry(uint64_t key) {
@@ -177,7 +179,8 @@ struct HashTable {
}
void dealloc() {
Dealloc(allocator, &values);
Dealloc(allocator, values);
values = NULL;
len = 0;
cap = 0;
}