Revert "misc: chore: Remove redundant code"

This reverts commit 05a88ccc94.
This commit is contained in:
KeatonTheBot
2025-03-15 20:00:22 -05:00
parent 7960ea643f
commit efd5a104b6
109 changed files with 412 additions and 271 deletions
@@ -18,7 +18,7 @@ namespace ARMeilleure.Translation.Cache
UnwindInfo = unwindInfo;
}
public int CompareTo(CacheEntry other)
public int CompareTo([AllowNull] CacheEntry other)
{
return Offset.CompareTo(other.Offset);
}
@@ -17,7 +17,7 @@ namespace ARMeilleure.Translation.Cache
Size = size;
}
public int CompareTo(MemoryBlock other)
public int CompareTo([AllowNull] MemoryBlock other)
{
return Offset.CompareTo(other.Offset);
}
@@ -32,7 +32,7 @@ namespace ARMeilleure.Translation.Cache
private static bool _initialized;
private static readonly List<ReservedRegion> _jitRegions = [];
private static int _activeRegionIndex;
private static int _activeRegionIndex = 0;
[SupportedOSPlatform("windows")]
[LibraryImport("kernel32.dll", SetLastError = true)]
@@ -79,7 +79,7 @@ namespace ARMeilleure.Translation.Cache
_unwindInfo = (UnwindInfo*)(workBufferPtr + _sizeOfRuntimeFunction);
_getRuntimeFunctionCallback = FunctionTableHandler;
_getRuntimeFunctionCallback = new GetRuntimeFunctionCallback(FunctionTableHandler);
result = RtlInstallFunctionTableCallback(
codeCachePtr | 3,
@@ -102,7 +102,10 @@ namespace ARMeilleure.Translation.Cache
bool result;
result = RtlDeleteFunctionTable(codeCachePtr | 3);
unsafe
{
result = RtlDeleteFunctionTable(codeCachePtr | 3);
}
if (!result)
{