diff --git a/src/Ryujinx.Common/Memory/MemoryOwner.cs b/src/Ryujinx.Common/Memory/MemoryOwner.cs index 5e567ab8d6..b7fe1db778 100644 --- a/src/Ryujinx.Common/Memory/MemoryOwner.cs +++ b/src/Ryujinx.Common/Memory/MemoryOwner.cs @@ -124,7 +124,7 @@ namespace Ryujinx.Common.Memory if (array is not null) { - ArrayPool.Shared.Return(array); + ArrayPool.Shared.Return(array, RuntimeHelpers.IsReferenceOrContainsReferences()); } } diff --git a/src/Ryujinx.Common/Memory/SpanOwner.cs b/src/Ryujinx.Common/Memory/SpanOwner.cs index a4b4adf32b..acb20bcad6 100644 --- a/src/Ryujinx.Common/Memory/SpanOwner.cs +++ b/src/Ryujinx.Common/Memory/SpanOwner.cs @@ -108,7 +108,7 @@ namespace Ryujinx.Common.Memory [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() { - ArrayPool.Shared.Return(_array); + ArrayPool.Shared.Return(_array, RuntimeHelpers.IsReferenceOrContainsReferences()); } } } diff --git a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index 6595ecef2a..91c6bded2c 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs @@ -616,7 +616,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } } - ArrayPool.Shared.Return(syncObjsArray); + ArrayPool.Shared.Return(syncObjsArray, true); return result; } diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs index b1af06b0d5..21c2730bf9 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KSynchronization.cs @@ -104,7 +104,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - ArrayPool>.Shared.Return(syncNodesArray); + ArrayPool>.Shared.Return(syncNodesArray, true); } _context.CriticalSection.Leave();