diff options
author | Sverker Eriksson <[email protected]> | 2016-10-14 16:59:34 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-10-14 16:59:34 +0200 |
commit | add49d36f93c03fc2edbf17663a4e7ddd982a5f0 (patch) | |
tree | 8f14cd262562cd26fc067657f98c002945494027 /erts/emulator/beam/erl_process_dict.c | |
parent | 6b588ecd5f62c6867ca1aea17c42f90159859fa9 (diff) | |
parent | 81cf5bc05e502809398116eaa0b78deb9336d68b (diff) | |
download | otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.tar.gz otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.tar.bz2 otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.zip |
Merge branch 'sverker/proc-dict-atom-hash/PR-1194'
* sverker/proc-dict-atom-hash:
kernel: Add test pdict_SUITE:literals
erts: Refactor process dict hash pre-calculation
Use atom value as hash value in process dictionary
Diffstat (limited to 'erts/emulator/beam/erl_process_dict.c')
-rw-r--r-- | erts/emulator/beam/erl_process_dict.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process_dict.c b/erts/emulator/beam/erl_process_dict.c index d8c2eaba94..d443fff22c 100644 --- a/erts/emulator/beam/erl_process_dict.c +++ b/erts/emulator/beam/erl_process_dict.c @@ -56,7 +56,7 @@ #define MAKE_HASH(Term) \ ((is_small(Term)) ? unsigned_val(Term) : \ ((is_atom(Term)) ? \ - (atom_tab(atom_val(Term))->slot.bucket.hvalue) : \ + atom_val(Term) : \ make_internal_hash(Term))) #define PD_SZ2BYTES(Sz) (sizeof(ProcDict) + ((Sz) - 1)*sizeof(Eterm)) @@ -408,6 +408,11 @@ static void pd_hash_erase_all(Process *p) } } +Uint32 erts_pd_make_hx(Eterm key) +{ + return MAKE_HASH(key); +} + Eterm erts_pd_hash_get_with_hx(Process *p, Uint32 hx, Eterm id) { unsigned int hval; |