set up so reusing scope when in a loop

This commit is contained in:
William Bell
2025-09-01 23:09:09 +01:00
parent 322716af0c
commit fd5b237dfe
10 changed files with 25 additions and 6 deletions

View File

@@ -21,9 +21,16 @@ struct hashmap_GC *createHashmap_GC() {
t->order = 1;
t->list = (struct node_GC **)ar_alloc(sizeof(struct node_GC *) * size);
memset(t->list, 0, sizeof(struct node_GC *) * size);
t->count = 0;
return t;
}
void clear_hashmap_GC(struct hashmap_GC *t) {
t->order = 1;
t->count = 0;
memset(t->list, 0, sizeof(struct node_GC *) * t->size);
}
void resize_hashmap_GC(struct hashmap_GC *t) {
int old_size = t->size;
int new_size = old_size * 2;

View File

@@ -25,6 +25,8 @@ struct hashmap_GC {
struct hashmap_GC *createHashmap_GC();
void clear_hashmap_GC(struct hashmap_GC *t);
int hashCode_GC(struct hashmap_GC *t, uint64_t hash);
int hashmap_remove_GC(struct hashmap_GC *t, uint64_t hash);