aboutsummaryrefslogtreecommitdiff
path: root/src/hash_table.c
blob: cced1940284d309aaece59bcb219bc39383428c9 (plain)
1
2
3
4
5
6
7
8
9
10
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;
}