Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: use hash list for fds instead of fixed array #428

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/re_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ uint32_t hash_joaat_pl(const struct pl *pl);
uint32_t hash_joaat_pl_ci(const struct pl *pl);
uint32_t hash_fast(const char *k, size_t len);
uint32_t hash_fast_str(const char *str);
uint32_t hash_fast_murmur(uint32_t key);
19 changes: 19 additions & 0 deletions src/hash/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,22 @@ uint32_t hash_fast_str(const char *str)

return h;
}


/**
* Calculate hash-value using modified murmur (fast finalize part)
*
* @param key Key value
*
* @return Calculated hash-value
*/
uint32_t hash_fast_murmur(uint32_t key)
{
key ^= key >> 16;
key *= 0x85ebca6b;
key ^= key >> 13;
key *= 0xc2b2ae35;
key ^= key >> 16;

return key;
}
Loading