mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-09 09:08:56 +02:00
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:
@@ -75,17 +75,21 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
|
||||
{
|
||||
errorReport.AppendLine("\tStackTrace:");
|
||||
|
||||
Span<ulong> stackTraceSpan = cpuContext64.StackTrace.AsSpan();
|
||||
|
||||
for (int i = 0; i < cpuContext64.StackTraceSize; i++)
|
||||
{
|
||||
errorReport.AppendLine($"\t\t0x{cpuContext64.StackTrace[i]:x16}");
|
||||
errorReport.AppendLine($"\t\t0x{stackTraceSpan[i]:x16}");
|
||||
}
|
||||
}
|
||||
|
||||
errorReport.AppendLine("\tRegisters:");
|
||||
|
||||
Span<ulong> xSpan = cpuContext64.X.AsSpan();
|
||||
|
||||
for (int i = 0; i < cpuContext64.X.Length; i++)
|
||||
for (int i = 0; i < xSpan.Length; i++)
|
||||
{
|
||||
errorReport.AppendLine($"\t\tX[{i:d2}]:\t0x{cpuContext64.X[i]:x16}");
|
||||
errorReport.AppendLine($"\t\tX[{i:d2}]:\t0x{xSpan[i]:x16}");
|
||||
}
|
||||
|
||||
errorReport.AppendLine();
|
||||
@@ -109,18 +113,22 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
|
||||
if (cpuContext32.StackTraceSize > 0)
|
||||
{
|
||||
errorReport.AppendLine("\tStackTrace:");
|
||||
|
||||
Span<uint> stackTraceSpan = cpuContext32.StackTrace.AsSpan();
|
||||
|
||||
for (int i = 0; i < cpuContext32.StackTraceSize; i++)
|
||||
{
|
||||
errorReport.AppendLine($"\t\t0x{cpuContext32.StackTrace[i]:x16}");
|
||||
errorReport.AppendLine($"\t\t0x{stackTraceSpan[i]:x16}");
|
||||
}
|
||||
}
|
||||
|
||||
errorReport.AppendLine("\tRegisters:");
|
||||
|
||||
Span<uint> xSpan = cpuContext32.X.AsSpan();
|
||||
|
||||
for (int i = 0; i < cpuContext32.X.Length; i++)
|
||||
for (int i = 0; i < xSpan.Length; i++)
|
||||
{
|
||||
errorReport.AppendLine($"\t\tX[{i:d2}]:\t0x{cpuContext32.X[i]:x16}");
|
||||
errorReport.AppendLine($"\t\tX[{i:d2}]:\t0x{xSpan[i]:x16}");
|
||||
}
|
||||
|
||||
errorReport.AppendLine();
|
||||
|
||||
Reference in New Issue
Block a user