File 0218-erts-Fix-reduction-count-in-re.patch of Package erlang
From 0ff928bd653cd20ede618decff5c31eb53187526 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Mon, 30 Aug 2021 11:12:19 +0200
Subject: [PATCH] erts: Fix reduction count in re
Before this fix, the loop_limit would always end up being
10 for global loops which caused a lot of unnecessary yielding.
---
erts/emulator/pcre/pcre_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erts/emulator/pcre/pcre_exec.c b/erts/emulator/pcre/pcre_exec.c
index 99c37f0657..e4da43e99f 100644
--- a/erts/emulator/pcre/pcre_exec.c
+++ b/erts/emulator/pcre/pcre_exec.c
@@ -7023,7 +7023,7 @@ if (extra_data != NULL)
{
md->loop_limit = extra_data->loop_limit;
if (extra_data->restart_data)
- md->loop_limit -= extra_data->loop_limit - exec_context->valid_utf_ystate.cnt;
+ md->loop_limit -= exec_context->valid_utf_ystate.cnt;
if (md->loop_limit < 10)
md->loop_limit = 10; /* At least do something if we've come this far... */
}
--
2.31.1