misc: Use nint/nuint instead of IntPtr/UIntPtr

This commit is contained in:
KeatonTheBot
2025-10-29 14:54:07 -05:00
parent 90cb9d42db
commit 2c50fbcc1f
163 changed files with 844 additions and 844 deletions
@@ -32,7 +32,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
[SupportedOSPlatform("windows")]
[LibraryImport("kernel32.dll", SetLastError = true)]
public static partial IntPtr FlushInstructionCache(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize);
public static partial nint FlushInstructionCache(nint hProcess, nint lpAddress, nuint dwSize);
public static void Initialize(IJitMemoryAllocator allocator)
{
@@ -63,7 +63,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
}
}
public unsafe static IntPtr Map(ReadOnlySpan<byte> code)
public unsafe static nint Map(ReadOnlySpan<byte> code)
{
lock (_lock)
{
@@ -71,7 +71,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
int funcOffset = Allocate(code.Length);
ReservedRegion targetRegion = _jitRegions[_activeRegionIndex];
IntPtr funcPtr = targetRegion.Pointer + funcOffset;
nint funcPtr = targetRegion.Pointer + funcOffset;
if (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
{
@@ -79,7 +79,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
{
fixed (byte* codePtr = code)
{
JitSupportDarwin.Copy(funcPtr, (IntPtr)codePtr, (ulong)code.Length);
JitSupportDarwin.Copy(funcPtr, (nint)codePtr, (ulong)code.Length);
}
}
}
@@ -91,7 +91,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
if (OperatingSystem.IsWindows() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
{
FlushInstructionCache(Process.GetCurrentProcess().Handle, funcPtr, (UIntPtr)code.Length);
FlushInstructionCache(Process.GetCurrentProcess().Handle, funcPtr, (nuint)code.Length);
}
else
{
@@ -105,7 +105,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
}
}
public static void Unmap(IntPtr pointer)
public static void Unmap(nint pointer)
{
lock (_lock)
{