From 5ad0c86aa11af73950804cadc284b2242684a231 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 9 Aug 2019 09:04:46 +0200 Subject: 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. --- erts/emulator/beam/register.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/beam/register.c') 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]; /* -- cgit v1.2.3