misc: Replace references to IntPtr/UIntPtr with nint/nuint + code cleanups.

This commit is contained in:
Evan Husted
2024-10-26 08:46:41 -05:00
parent a09d314817
commit dfb4854d19
172 changed files with 902 additions and 914 deletions

View File

@@ -30,7 +30,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked
private bool _disposed;
public IntPtr PageTablePointer => _nativePageTable.Pointer;
public nint PageTablePointer => _nativePageTable.Pointer;
public NativePageTable(ulong asSize)
{
@@ -83,7 +83,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked
public void Unmap(ulong va, ulong size)
{
IntPtr guardPagePtr = GetGuardPagePointer();
nint guardPagePtr = GetGuardPagePointer();
while (size != 0)
{
@@ -104,7 +104,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked
return pte + (va & PageMask);
}
public void Update(ulong va, IntPtr ptr, ulong size)
public void Update(ulong va, nint ptr, ulong size)
{
ulong remainingSize = size;
@@ -148,7 +148,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked
Debug.Assert(pageSpan.Length == _entriesPerPtPage);
IntPtr guardPagePtr = GetGuardPagePointer();
nint guardPagePtr = GetGuardPagePointer();
for (int i = 0; i < pageSpan.Length; i++)
{
@@ -160,12 +160,12 @@ namespace Ryujinx.Cpu.Jit.HostTracked
}
}
private IntPtr GetGuardPagePointer()
private nint GetGuardPagePointer()
{
return _nativePageTable.GetPointer(_nativePageTable.Size - _hostPageSize, _hostPageSize);
}
private static ulong GetPte(ulong va, IntPtr ptr)
private static ulong GetPte(ulong va, nint ptr)
{
Debug.Assert((va & PageMask) == 0);