aboutsummaryrefslogtreecommitdiff
path: root/src/hash_table.c
diff options
context:
space:
mode:
authorPreston Pan <ret2pop@gmail.com>2024-12-26 21:18:05 -0800
committerPreston Pan <ret2pop@gmail.com>2024-12-26 21:18:05 -0800
commitfd14f6fbf8206589d2a0ad8f0793845cb8faf1d7 (patch)
treeac3f8288b9e5e9d5e3acaf7d07694dc04157233a /src/hash_table.c
parente75d6f6b8f4512a5bbfecbfa8c17f0bb687e3d55 (diff)
stuff
Diffstat (limited to 'src/hash_table.c')
-rw-r--r--src/hash_table.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hash_table.c b/src/hash_table.c
new file mode 100644
index 0000000..cced194
--- /dev/null
+++ b/src/hash_table.c
@@ -0,0 +1,11 @@
+#include <hash_table.h>
+#include <stdlib.h>
+#include <helpers.h>
+
+ht_t *init_ht(size_t size) {
+ ht_t *ht = safe_calloc(1, sizeof(size));
+ size_t realsize = size == 0 ? DEFAULT_HT_SIZE : size;
+ ht->buckets = safe_calloc(realsize, sizeof(sll_t *));
+ ht->size = realsize;
+ return ht;
+}