From 7d26e4ac7b61c4b6a860f6fd9aabdc8e653bc2d7 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Tue, 18 Oct 2022 22:02:45 -0300
Subject: Fix mapping leaks caused by UnmapView not working on Linux (#3650)

* Add test for UnmapView mapping leaks

* Throw when UnmapView fails on Linux

* Fix UnmapView

* Remove throw
---
 Ryujinx.Memory/MemoryManagementUnix.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'Ryujinx.Memory/MemoryManagementUnix.cs')

diff --git a/Ryujinx.Memory/MemoryManagementUnix.cs b/Ryujinx.Memory/MemoryManagementUnix.cs
index db7539f0..df3fcea9 100644
--- a/Ryujinx.Memory/MemoryManagementUnix.cs
+++ b/Ryujinx.Memory/MemoryManagementUnix.cs
@@ -177,7 +177,7 @@ namespace Ryujinx.Memory
 
         public static void UnmapView(IntPtr location, ulong size)
         {
-            mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED, -1, 0);
+            mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED | MmapFlags.MAP_PRIVATE | MmapFlags.MAP_ANONYMOUS | MmapFlags.MAP_NORESERVE, -1, 0);
         }
     }
 }
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2