mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-25 11:20:06 +02:00
misc: Use nint/nuint instead of IntPtr/UIntPtr
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Ryujinx.Memory
|
||||
O_SYNC = 256,
|
||||
}
|
||||
|
||||
public const IntPtr MAP_FAILED = -1;
|
||||
public const nint MAP_FAILED = -1;
|
||||
|
||||
private const int MAP_ANONYMOUS_LINUX_GENERIC = 0x20;
|
||||
private const int MAP_NORESERVE_LINUX_GENERIC = 0x4000;
|
||||
@@ -58,37 +58,37 @@ namespace Ryujinx.Memory
|
||||
public const int MADV_REMOVE = 9;
|
||||
|
||||
[LibraryImport("libc", EntryPoint = "mmap", SetLastError = true)]
|
||||
private static partial IntPtr Internal_mmap(IntPtr address, ulong length, MmapProts prot, int flags, int fd, long offset);
|
||||
private static partial nint Internal_mmap(nint address, ulong length, MmapProts prot, int flags, int fd, long offset);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int mprotect(IntPtr address, ulong length, MmapProts prot);
|
||||
public static partial int mprotect(nint address, ulong length, MmapProts prot);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int munmap(IntPtr address, ulong length);
|
||||
public static partial int munmap(nint address, ulong length);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial IntPtr mremap(IntPtr old_address, ulong old_size, ulong new_size, int flags, IntPtr new_address);
|
||||
public static partial nint mremap(nint old_address, ulong old_size, ulong new_size, int flags, nint new_address);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int madvise(IntPtr address, ulong size, int advice);
|
||||
public static partial int madvise(nint address, ulong size, int advice);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int mkstemp(IntPtr template);
|
||||
public static partial int mkstemp(nint template);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int unlink(IntPtr pathname);
|
||||
public static partial int unlink(nint pathname);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int ftruncate(int fildes, IntPtr length);
|
||||
public static partial int ftruncate(int fildes, nint length);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int close(int fd);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int shm_open(IntPtr name, int oflag, uint mode);
|
||||
public static partial int shm_open(nint name, int oflag, uint mode);
|
||||
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int shm_unlink(IntPtr name);
|
||||
public static partial int shm_unlink(nint name);
|
||||
|
||||
[DllImport("android")]
|
||||
internal static extern int ASharedMemory_create(IntPtr name, nuint size);
|
||||
@@ -168,7 +168,7 @@ namespace Ryujinx.Memory
|
||||
return result;
|
||||
}
|
||||
|
||||
public static IntPtr Mmap(IntPtr address, ulong length, MmapProts prot, MmapFlags flags, int fd, long offset)
|
||||
public static nint Mmap(nint address, ulong length, MmapProts prot, MmapFlags flags, int fd, long offset)
|
||||
{
|
||||
return Internal_mmap(address, length, prot, MmapFlagsToSystemFlags(flags), fd, offset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user