diff options
author | Mary <mary@mary.zone> | 2023-06-26 03:37:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 01:37:12 +0000 |
commit | 9860bfb2cdb2a3f6093d936d647b1f254a23120d (patch) | |
tree | 4944c305d59daf546b63f1f048b6b9334ed5fb8b /src/Ryujinx.Memory/MemoryManagementUnix.cs | |
parent | f6ada8d1697502a6b37192c9cf9a32acfa28b51a (diff) |
misc: memory: Migrate from OutOfMemoryException to SystemException entirely (#5399)1.1.920
Fix a regression with address space allocation while providing more
information about the context of the exception.
Diffstat (limited to 'src/Ryujinx.Memory/MemoryManagementUnix.cs')
-rw-r--r-- | src/Ryujinx.Memory/MemoryManagementUnix.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Ryujinx.Memory/MemoryManagementUnix.cs b/src/Ryujinx.Memory/MemoryManagementUnix.cs index d665b229..4314c392 100644 --- a/src/Ryujinx.Memory/MemoryManagementUnix.cs +++ b/src/Ryujinx.Memory/MemoryManagementUnix.cs @@ -147,12 +147,12 @@ namespace Ryujinx.Memory fd = shm_open((IntPtr)pMemName, 0x2 | 0x200 | 0x800 | 0x400, 384); // O_RDWR | O_CREAT | O_EXCL | O_TRUNC, 0600 if (fd == -1) { - throw new OutOfMemoryException(); + throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); } if (shm_unlink((IntPtr)pMemName) != 0) { - throw new OutOfMemoryException(); + throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); } } } @@ -165,22 +165,22 @@ namespace Ryujinx.Memory fd = mkstemp((IntPtr)pFileName); if (fd == -1) { - throw new OutOfMemoryException(); + throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); } if (unlink((IntPtr)pFileName) != 0) { - throw new OutOfMemoryException(); + throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); } } } if (ftruncate(fd, (IntPtr)size) != 0) { - throw new OutOfMemoryException(); + throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); } - return (IntPtr)fd; + return fd; } public static void DestroySharedMemory(IntPtr handle) |