diff options
Diffstat (limited to 'ARMeilleure')
-rw-r--r-- | ARMeilleure/CodeGen/Arm64/CodeGenContext.cs | 3 | ||||
-rw-r--r-- | ARMeilleure/CodeGen/X86/Assembler.cs | 3 | ||||
-rw-r--r-- | ARMeilleure/CodeGen/X86/CodeGenContext.cs | 3 | ||||
-rw-r--r-- | ARMeilleure/Translation/PTC/Ptc.cs | 7 | ||||
-rw-r--r-- | ARMeilleure/Translation/PTC/PtcProfiler.cs | 5 |
5 files changed, 13 insertions, 8 deletions
diff --git a/ARMeilleure/CodeGen/Arm64/CodeGenContext.cs b/ARMeilleure/CodeGen/Arm64/CodeGenContext.cs index cebfbde1..0dd5355f 100644 --- a/ARMeilleure/CodeGen/Arm64/CodeGenContext.cs +++ b/ARMeilleure/CodeGen/Arm64/CodeGenContext.cs @@ -1,6 +1,7 @@ using ARMeilleure.CodeGen.Linking; using ARMeilleure.CodeGen.RegisterAllocators; using ARMeilleure.IntermediateRepresentation; +using Ryujinx.Common.Memory; using System; using System.Collections.Generic; using System.IO; @@ -59,7 +60,7 @@ namespace ARMeilleure.CodeGen.Arm64 public CodeGenContext(AllocationResult allocResult, int maxCallArgs, int blocksCount, bool relocatable) { - _stream = new MemoryStream(); + _stream = MemoryStreamManager.Shared.GetStream(); AllocResult = allocResult; diff --git a/ARMeilleure/CodeGen/X86/Assembler.cs b/ARMeilleure/CodeGen/X86/Assembler.cs index c15deadc..2ea4208b 100644 --- a/ARMeilleure/CodeGen/X86/Assembler.cs +++ b/ARMeilleure/CodeGen/X86/Assembler.cs @@ -1,5 +1,6 @@ using ARMeilleure.CodeGen.Linking; using ARMeilleure.IntermediateRepresentation; +using Ryujinx.Common.Memory; using System; using System.Collections.Generic; using System.Diagnostics; @@ -1285,7 +1286,7 @@ namespace ARMeilleure.CodeGen.X86 // Write the code, ignoring the dummy bytes after jumps, into a new stream. _stream.Seek(0, SeekOrigin.Begin); - using var codeStream = new MemoryStream(); + using var codeStream = MemoryStreamManager.Shared.GetStream(); var assembler = new Assembler(codeStream, HasRelocs); bool hasRelocs = HasRelocs; diff --git a/ARMeilleure/CodeGen/X86/CodeGenContext.cs b/ARMeilleure/CodeGen/X86/CodeGenContext.cs index eee71bd7..89948724 100644 --- a/ARMeilleure/CodeGen/X86/CodeGenContext.cs +++ b/ARMeilleure/CodeGen/X86/CodeGenContext.cs @@ -1,5 +1,6 @@ using ARMeilleure.CodeGen.RegisterAllocators; using ARMeilleure.IntermediateRepresentation; +using Ryujinx.Common.Memory; using System.IO; using System.Numerics; @@ -22,7 +23,7 @@ namespace ARMeilleure.CodeGen.X86 public CodeGenContext(AllocationResult allocResult, int maxCallArgs, int blocksCount, bool relocatable) { - _stream = new MemoryStream(); + _stream = MemoryStreamManager.Shared.GetStream(); _blockLabels = new Operand[blocksCount]; AllocResult = allocResult; diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index 276ec788..0b23fd04 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -6,6 +6,7 @@ using ARMeilleure.Memory; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; +using Ryujinx.Common.Memory; using System; using System.Buffers.Binary; using System.Collections.Generic; @@ -150,10 +151,10 @@ namespace ARMeilleure.Translation.PTC private void InitializeCarriers() { - _infosStream = new MemoryStream(); + _infosStream = MemoryStreamManager.Shared.GetStream(); _codesList = new List<byte[]>(); - _relocsStream = new MemoryStream(); - _unwindInfosStream = new MemoryStream(); + _relocsStream = MemoryStreamManager.Shared.GetStream(); + _unwindInfosStream = MemoryStreamManager.Shared.GetStream(); } private void DisposeCarriers() diff --git a/ARMeilleure/Translation/PTC/PtcProfiler.cs b/ARMeilleure/Translation/PTC/PtcProfiler.cs index 030ccff5..391e29c7 100644 --- a/ARMeilleure/Translation/PTC/PtcProfiler.cs +++ b/ARMeilleure/Translation/PTC/PtcProfiler.cs @@ -1,6 +1,7 @@ using ARMeilleure.State; using Ryujinx.Common; using Ryujinx.Common.Logging; +using Ryujinx.Common.Memory; using System; using System.Buffers.Binary; using System.Collections.Concurrent; @@ -182,7 +183,7 @@ namespace ARMeilleure.Translation.PTC return false; } - using (MemoryStream stream = new MemoryStream()) + using (MemoryStream stream = MemoryStreamManager.Shared.GetStream()) { Debug.Assert(stream.Seek(0L, SeekOrigin.Begin) == 0L && stream.Length == 0L); @@ -274,7 +275,7 @@ namespace ARMeilleure.Translation.PTC outerHeader.SetHeaderHash(); - using (MemoryStream stream = new MemoryStream()) + using (MemoryStream stream = MemoryStreamManager.Shared.GetStream()) { Debug.Assert(stream.Seek(0L, SeekOrigin.Begin) == 0L && stream.Length == 0L); |