diff options
author | Björn Gustavsson <[email protected]> | 2019-05-10 14:33:00 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-05-10 14:36:44 +0200 |
commit | c6d5af1054f8d555a69111f29b59d5485ef8e48f (patch) | |
tree | f5c5a52e70cdbb61489f724fbeee2d7c84774c2d | |
parent | 603c980080218d9997f3fdc7015bb23987fad29c (diff) | |
download | otp-c6d5af1054f8d555a69111f29b59d5485ef8e48f.tar.gz otp-c6d5af1054f8d555a69111f29b59d5485ef8e48f.tar.bz2 otp-c6d5af1054f8d555a69111f29b59d5485ef8e48f.zip |
Eliminate process yield after each call to length/1
After calculating the length of a list, length/1 would accidentally
bump all remaining reductions, forcing the process to yield. Correct
the calculation.
-rw-r--r-- | erts/emulator/beam/erl_bif_guard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_guard.c b/erts/emulator/beam/erl_bif_guard.c index c921b66a7e..09757e473b 100644 --- a/erts/emulator/beam/erl_bif_guard.c +++ b/erts/emulator/beam/erl_bif_guard.c @@ -306,7 +306,7 @@ Eterm erts_trapping_length_1(Process* p, Eterm* args) * We reached the end of the list successfully. Bump reductions * and return result. */ - BUMP_REDS(p, saved_max_iter / 16); + BUMP_REDS(p, (saved_max_iter - max_iter) / 16); return make_small(i); } |