aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-03-30 21:45:42 +0200
committerSverker Eriksson <[email protected]>2015-03-30 21:45:42 +0200
commit450e5b610ac2de4817606c2966d9fb5a9850887a (patch)
treec4b53ab33c91a0da50f1f44248a6e15132a128dd /erts/emulator/beam/utils.c
parente4da94bee94bdd7e0dbb2e5021ab4cc5f89f8256 (diff)
downloadotp-450e5b610ac2de4817606c2966d9fb5a9850887a.tar.gz
otp-450e5b610ac2de4817606c2966d9fb5a9850887a.tar.bz2
otp-450e5b610ac2de4817606c2966d9fb5a9850887a.zip
erts: Optimize == and /= for unequal big maps
Bail out as soon as we find a diff between maps if we are not interested in term order.
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 8fc8962e4f..889c217b0b 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -2911,7 +2911,7 @@ static int cmp_atoms(Eterm a, Eterm b)
*/
Sint cmp(Eterm a, Eterm b)
{
- return erts_cmp(a, b, 0);
+ return erts_cmp(a, b, 0, 0);
}
#endif
@@ -2920,9 +2920,10 @@ Sint cmp(Eterm a, Eterm b)
* exact = 0 -> arith-based compare
*/
#if HALFWORD_HEAP
-Sint erts_cmp_rel_opt(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base, int exact)
+Sint erts_cmp_rel_opt(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base,
+ int exact, int eq_only)
#else
-Sint erts_cmp(Eterm a, Eterm b, int exact)
+Sint erts_cmp(Eterm a, Eterm b, int exact, int eq_only)
#endif
{
#define PSTACK_TYPE struct erts_cmp_hashmap_state
@@ -3742,7 +3743,7 @@ pop_next:
return 0;
not_equal:
- if (!PSTACK_IS_EMPTY(hmap_stack)) {
+ if (!PSTACK_IS_EMPTY(hmap_stack) && !eq_only) {
WSTACK_ROLLBACK(stack, PSTACK_TOP(hmap_stack)->wstack_rollback);
goto pop_next;
}