Memory Changes part 2

* Slightly refactors RangeLists from the last Memory Changes MR, which fixes issue 61.

* Convert as many const size array iterators to span iterators as possible. When iterating over a const size array, every iteration created a Span, now only the first iteration does in most places.

* Now using object pooling for a few object types that were rapidly deleted and recreated.

* Converted a few flag checks to binary operations to save memory allocations.
This commit is contained in:
LotP
2025-08-26 15:30:12 -05:00
committed by KeatonTheBot
parent 01cb33f658
commit 171624e7f0
89 changed files with 2121 additions and 1157 deletions
@@ -23,12 +23,14 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{
newState.TouchesCount = points.Length;
int pointsLength = Math.Min(points.Length, newState.Touches.Length);
Span<TouchState> touchesSpan = newState.Touches.AsSpan();
int pointsLength = Math.Min(points.Length, touchesSpan.Length);
for (int i = 0; i < pointsLength; ++i)
{
TouchPoint pi = points[i];
newState.Touches[i] = new TouchState
touchesSpan[i] = new TouchState
{
DeltaTime = newState.SamplingNumber,
Attribute = pi.Attribute,