From 8a8637b36a211aa188a8b24440ba4cd267fe5bf7 Mon Sep 17 00:00:00 2001 From: LDj3SNuD Date: Sun, 25 Sep 2022 04:05:40 +0200 Subject: [PATCH] Do not clear the rejit queue when overlaps count is equal to 0. --- ARMeilleure/Translation/Translator.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ARMeilleure/Translation/Translator.cs b/ARMeilleure/Translation/Translator.cs index ee8e3e8b5..c50b1c3d0 100644 --- a/ARMeilleure/Translation/Translator.cs +++ b/ARMeilleure/Translation/Translator.cs @@ -455,13 +455,16 @@ namespace ARMeilleure.Translation public void InvalidateJitCacheRegion(ulong address, ulong size) { - // If rejit is running, stop it as it may be trying to rejit a function on the invalidated region. - ClearRejitQueue(allowRequeue: true); - ulong[] overlapAddresses = Array.Empty(); int overlapsCount = Functions.GetOverlaps(address, size, ref overlapAddresses); + if (overlapsCount != 0) + { + // If rejit is running, stop it as it may be trying to rejit a function on the invalidated region. + ClearRejitQueue(allowRequeue: true); + } + for (int index = 0; index < overlapsCount; index++) { ulong overlapAddress = overlapAddresses[index];