util: introduce two trivial hash_ops
Will be used in a later commit.
This commit is contained in:
@@ -71,6 +71,19 @@ const struct hash_ops trivial_hash_ops = {
|
||||
.compare = trivial_compare_func,
|
||||
};
|
||||
|
||||
const struct hash_ops trivial_hash_ops_free = {
|
||||
.hash = trivial_hash_func,
|
||||
.compare = trivial_compare_func,
|
||||
.free_key = free,
|
||||
};
|
||||
|
||||
const struct hash_ops trivial_hash_ops_free_free = {
|
||||
.hash = trivial_hash_func,
|
||||
.compare = trivial_compare_func,
|
||||
.free_key = free,
|
||||
.free_value = free,
|
||||
};
|
||||
|
||||
void uint64_hash_func(const uint64_t *p, struct siphash *state) {
|
||||
siphash24_compress(p, sizeof(uint64_t), state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user