summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/register.c
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2019-08-09 09:04:46 +0200
committerLukas Larsson <lukas@erlang.org>2019-08-09 15:21:42 +0200
commit5ad0c86aa11af73950804cadc284b2242684a231 (patch)
tree6689ebf6d24cc3aad8b30e2fea65a81c79ff6fba /erts/emulator/beam/register.c
parent0cf06f07be27de4219743df3098c8cf66b3848c2 (diff)
downloaderlang-5ad0c86aa11af73950804cadc284b2242684a231.tar.gz
erts: Change the default hash implementation to use fibonacci hash
Fibonacci hashing is a variant of multiplicative hashing that uses a constant based on the golden ratio.
Diffstat (limited to 'erts/emulator/beam/register.c')
-rw-r--r--erts/emulator/beam/register.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/register.c b/erts/emulator/beam/register.c
index d69632d8c8..edf1e5b0cb 100644
--- a/erts/emulator/beam/register.c
+++ b/erts/emulator/beam/register.c
@@ -279,7 +279,7 @@ erts_whereis_name_to_id(Process *c_p, Eterm name)
erts_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
hval = REG_HASH(name);
- ix = hval % process_reg.size;
+ ix = hash_get_slot(&process_reg, hval);
b = process_reg.bucket[ix];
/*
@@ -343,7 +343,7 @@ erts_whereis_name(Process *c_p,
*/
hval = REG_HASH(name);
- ix = hval % process_reg.size;
+ ix = hash_get_slot(&process_reg, hval);
b = process_reg.bucket[ix];
/*