aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-06-08 10:48:17 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-06-08 10:48:17 +0200
commit9f592aae079452fa1ee43afcdba0c8cccf254cfb (patch)
tree9835a21c94f90aec7633ef2bff00ca21b552fa5d /erts/emulator/beam
parente6e7ae017ef83ace6e5d303a3860245d623d173a (diff)
parentd79f77985100d2f90a0021f7ebae20ec7c99e93f (diff)
downloadotp-9f592aae079452fa1ee43afcdba0c8cccf254cfb.tar.gz
otp-9f592aae079452fa1ee43afcdba0c8cccf254cfb.tar.bz2
otp-9f592aae079452fa1ee43afcdba0c8cccf254cfb.zip
Merge branch 'egil/fix-internal_hash-list-opt'
* egil/fix-internal_hash-list-opt: erts: Fix faulty list optimization in make_internal_hash
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 965de748c9..cecd88197e 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -1140,7 +1140,7 @@ make_hash2(Eterm term)
ERTS_UNDEF(hash_xor_pairs, 0);
-/* (HCONST * {2, ..., 16}) mod 2^32 */
+/* (HCONST * {2, ..., 22}) mod 2^32 */
#define HCONST_2 0x3c6ef372UL
#define HCONST_3 0xdaa66d2bUL
#define HCONST_4 0x78dde6e4UL
@@ -1161,6 +1161,7 @@ make_hash2(Eterm term)
#define HCONST_19 0xbe1e08bbUL
#define HCONST_20 0x5c558274UL
#define HCONST_21 0xfa8cfc2dUL
+#define HCONST_22 0x98c475e6UL
#define HASH_MAP_TAIL (_make_header(1,_TAG_HEADER_REF))
#define HASH_MAP_PAIR (_make_header(2,_TAG_HEADER_REF))
@@ -1645,8 +1646,9 @@ make_internal_hash(Eterm term)
break;
ptr = list_val(term);
}
- if (c > 0)
- UINT32_HASH(sh, HCONST_4);
+ if (c > 0)
+ UINT32_HASH_2(sh, (Uint32)c, HCONST_22);
+
if (is_list(term)) {
tmp = CDR(ptr);
CONST_HASH(HCONST_17); /* Hash CAR in cons cell */