Skip to content

Commit

Permalink
misc: Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Nov 10, 2024
1 parent 299be82 commit 4aae82b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/ARMeilleure/Translation/Dominance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static void FindDominanceFrontiers(ControlFlowGraph cfg)
{
continue;
}

for (int pBlkIndex = 0; pBlkIndex < block.Predecessors.Count; pBlkIndex++)
{
BasicBlock current = block.Predecessors[pBlkIndex];
Expand Down
20 changes: 9 additions & 11 deletions src/ARMeilleure/Translation/PTC/Ptc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -848,18 +849,15 @@ void TranslateFuncs()
}
}

List<Thread> threads = new();

for (int i = 0; i < degreeOfParallelism; i++)
{
Thread thread = new(TranslateFuncs)
{
IsBackground = true,
Name = "Ptc.TranslateThread." + i
};

threads.Add(thread);
}
List<Thread> threads = Enumerable.Range(0, degreeOfParallelism)
.Select(idx =>
new Thread(TranslateFuncs)
{
IsBackground = true,
Name = "Ptc.TranslateThread." + idx
}
).ToList();

Stopwatch sw = Stopwatch.StartNew();

Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx.Common/Logging/Targets/AsyncLogTargetWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public class AsyncLogTargetWrapper : ILogTarget
string ILogTarget.Name { get => _target.Name; }

public AsyncLogTargetWrapper(ILogTarget target)
: this(target, -1, AsyncLogTargetOverflowAction.Block)
: this(target, -1)
{ }

public AsyncLogTargetWrapper(ILogTarget target, int queueLimit, AsyncLogTargetOverflowAction overflowAction)
public AsyncLogTargetWrapper(ILogTarget target, int queueLimit = -1, AsyncLogTargetOverflowAction overflowAction = AsyncLogTargetOverflowAction.Block)
{
_target = target;
_messageQueue = new BlockingCollection<LogEventArgs>(queueLimit);
Expand Down

0 comments on commit 4aae82b

Please sign in to comment.