19#ifndef LIBAARUFORMAT_HASH_MAP_H
20#define LIBAARUFORMAT_HASH_MAP_H
bool lookup_map(const hash_map_t *map, uint64_t key, uint64_t *out_value)
Looks up a value by key in the hash map.
hash_map_t * create_map(size_t size)
Creates a new hash map with the specified initial size.
bool insert_map(hash_map_t *map, uint64_t key, uint64_t value)
Inserts a key-value pair into the hash map.
void free_map(hash_map_t *map)
Frees all memory associated with a hash map.
Minimal open-addressing hash map for 64-bit key/value pairs used in deduplication lookup.
size_t count
Number of active (filled) entries.
size_t size
Allocated slot capacity of table.
kv_pair_t * table
Array of key/value slots of length == size.
Single key/value slot used internally by the open-addressing hash map.
uint64_t value
Associated value payload (64-bit) stored alongside the key.
uint64_t key
Stored key (64-bit). May use a reserved sentinel to denote an empty slot.