From 5912bd2beb42e1853fdcf11e4bb87e063a0ef35b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Fri, 9 Mar 2018 23:12:57 -0300 Subject: Disable memory checks by default, even on debug, move ram memory allocation inside the CPU, since the size if fixed anyway, better heap region size --- Ryujinx.Core/Switch.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Ryujinx.Core/Switch.cs') diff --git a/Ryujinx.Core/Switch.cs b/Ryujinx.Core/Switch.cs index 1acd87f0..dff7802b 100644 --- a/Ryujinx.Core/Switch.cs +++ b/Ryujinx.Core/Switch.cs @@ -5,13 +5,12 @@ using Ryujinx.Core.Settings; using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gpu; using System; -using System.Runtime.InteropServices; namespace Ryujinx.Core { public class Switch : IDisposable { - public IntPtr Ram {get; private set; } + internal AMemory Memory { get; private set; } internal NsGpu Gpu { get; private set; } internal Horizon Os { get; private set; } @@ -25,13 +24,13 @@ namespace Ryujinx.Core public Switch(IGalRenderer Renderer) { - Ram = Marshal.AllocHGlobal((IntPtr)AMemoryMgr.RamSize); + Memory = new AMemory(); Gpu = new NsGpu(Renderer); VFs = new VirtualFs(); - Hid = new Hid(Ram); + Hid = new Hid(this); Statistics = new PerformanceStatistics(); @@ -72,10 +71,10 @@ namespace Ryujinx.Core { if (disposing) { + Memory.Dispose(); + VFs.Dispose(); } - - Marshal.FreeHGlobal(Ram); } } } \ No newline at end of file -- cgit v1.2.3