1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Merge commit 'df5a08e7c717ff421a52b4144d741f0a9749159f' into thread-next

This commit is contained in:
Maria Matejka
2023-10-31 16:48:48 +01:00
3 changed files with 85 additions and 0 deletions

View File

@@ -235,6 +235,14 @@ mem_hash_mix(u64 *h, const void *p, uint s)
*h = *h * multiplier + pp[i];
}
static inline void
mem_hash_mix_str(u64 *h, const char *s)
{
const u64 multiplier = 0xb38bc09a61202731ULL;
while (s)
*h = *h * multiplier + *s++;
}
static inline void
mem_hash_mix_num(u64 *h, u64 val)
{