aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-10-07 23:40:37 -0300
committerGitHub <noreply@github.com>2018-10-07 23:40:37 -0300
commit74ca82c5346e341b34909fcf0d2911c6bc9d33c1 (patch)
tree3353d68a52bd2a7e83b03b5c8e702ae308418986
parent625fc8c0e0f7a10bbdabe86f9cc86b16d1a62be3 (diff)
Tweak cpu cache deletion policy values (#433)
* Tweak cpu cache deletion policy values * Address PR feedback
-rw-r--r--ChocolArm64/ATranslatorCache.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/ChocolArm64/ATranslatorCache.cs b/ChocolArm64/ATranslatorCache.cs
index e34cc397..3e3c5ab6 100644
--- a/ChocolArm64/ATranslatorCache.cs
+++ b/ChocolArm64/ATranslatorCache.cs
@@ -8,9 +8,14 @@ namespace ChocolArm64
{
class ATranslatorCache
{
- private const int MaxTotalSize = 2 * 1024 * 256;
- private const int MaxTimeDelta = 30000;
- private const int MinCallCountForUpdate = 1000;
+ //Maximum size of the cache, in bytes, measured in ARM code size.
+ private const int MaxTotalSize = 4 * 1024 * 256;
+
+ //Minimum time required in milliseconds for a method to be eligible for deletion.
+ private const int MinTimeDelta = 2 * 60000;
+
+ //Minimum number of calls required to update the timestamp.
+ private const int MinCallCountForUpdate = 250;
private class CacheBucket
{
@@ -134,7 +139,7 @@ namespace ChocolArm64
int TimeDelta = RingDelta(Bucket.Timestamp, Timestamp);
- if ((uint)TimeDelta <= (uint)MaxTimeDelta)
+ if ((uint)TimeDelta <= (uint)MinTimeDelta)
{
break;
}