add not and or, while also improving performance.

This commit is contained in:
William Bell
2025-09-07 21:03:57 +01:00
parent 57728af0b6
commit 23c4a7ebd1
36 changed files with 201 additions and 458 deletions

View File

@@ -15,18 +15,19 @@
#include <string.h>
struct hashmap_GC *createHashmap_GC() {
size_t size = 8;
struct hashmap_GC *t =
(struct hashmap_GC *)ar_alloc(sizeof(struct hashmap_GC));
t->size = size;
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;
size_t size = 8;
struct hashmap_GC *t =
(struct hashmap_GC *)ar_alloc(sizeof(struct hashmap_GC) + sizeof(struct node_GC *) * size);
t->size = size;
t->order = 1;
t->list = (struct node_GC **)((char*)t + sizeof(struct hashmap_GC));
memset(t->list, 0, sizeof(struct node_GC *) * size);
t->count = 0;
return t;
}
void clear_hashmap_GC(struct hashmap_GC *t) {
if (!t->count) return;
t->order = 1;
t->count = 0;
memset(t->list, 0, sizeof(struct node_GC *) * t->size);