aboutsummaryrefslogtreecommitdiff
path: root/include/bh/internal/hashmap.h
blob: 6b59393818e4ad4bb94308a5323cedc0b975e317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef BH_INTERNAL_HASHMAP_H
#define BH_INTERNAL_HASHMAP_H

#include "bh.h"
#include <bh/hashmap.h>

typedef struct bh_hashmap_node_s
{
    void *key;
    void *value;
} bh_hashmap_node_t;

struct bh_hashmap_s
{
    bh_hashmap_node_t *data;
    size_t *psls;
    size_t size;
    size_t capacity;
    size_t threshold;
    bh_equal_cb_t equal;
    bh_hash_cb_t hash;
    float factor;
};

void bh_hashmap_init(bh_hashmap_t *hashmap,
                     bh_equal_cb_t equal,
                     bh_hash_cb_t hash);

void bh_hashmap_destroy(bh_hashmap_t *hashmap);

#endif /* BH_INTERNAL_HASHMAP_H */