mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 06:09:11 +00:00
Address Feedback
This commit is contained in:
parent
00fee4715e
commit
44ede2c6b8
2 changed files with 5 additions and 8 deletions
|
@ -105,6 +105,7 @@ namespace ARMeilleure.Translation
|
||||||
public void Execute(State.ExecutionContext context, ulong address)
|
public void Execute(State.ExecutionContext context, ulong address)
|
||||||
{
|
{
|
||||||
int physicalCoreCount = SystemInfo.GetPhysicalCoreCount();
|
int physicalCoreCount = SystemInfo.GetPhysicalCoreCount();
|
||||||
|
|
||||||
if (Interlocked.Increment(ref _threadCount) == 1)
|
if (Interlocked.Increment(ref _threadCount) == 1)
|
||||||
{
|
{
|
||||||
IsReadyForTranslation.WaitOne();
|
IsReadyForTranslation.WaitOne();
|
||||||
|
|
|
@ -94,17 +94,11 @@ namespace Ryujinx.Common.SystemInfo
|
||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
{
|
{
|
||||||
string cpuCoresLine = File.ReadLines("/proc/cpuinfo")
|
string cpuCoresLine = File.ReadLines("/proc/cpuinfo").FirstOrDefault(line => line.Contains("cpu cores"));
|
||||||
.FirstOrDefault(line => line.Contains("cpu cores"));
|
|
||||||
|
|
||||||
if (cpuCoresLine != null)
|
if (cpuCoresLine != null)
|
||||||
{
|
{
|
||||||
string[] parts = cpuCoresLine.Split(':');
|
string[] parts = cpuCoresLine.Split(':');
|
||||||
if (parts.Length == 2 && int.TryParse(parts[1].Trim(), out int cores))
|
|
||||||
{
|
|
||||||
coreCount = cores;
|
|
||||||
Console.WriteLine("Number of physical cores: " + coreCount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
|
@ -122,13 +116,15 @@ namespace Ryujinx.Common.SystemInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
process.Start();
|
process.Start();
|
||||||
|
|
||||||
coreCount = int.Parse(process.StandardOutput.ReadToEnd());
|
coreCount = int.Parse(process.StandardOutput.ReadToEnd());
|
||||||
|
|
||||||
process.WaitForExit();
|
process.WaitForExit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("An error occurred while trying to get the physical core count: " + ex.Message);
|
Logger.Error?.Print(LogClass.Application,"An error occurred while trying to get the physical core count: {ex.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return coreCount;
|
return coreCount;
|
||||||
|
|
Loading…
Reference in a new issue