blob: 2f66d450b7dd2162f0b2116db196aa9276678d92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include "../include/hash_table.h"
#include "../include/helpers.h"
#include <stdlib.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;
}
|