mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-12 21:59:12 +00:00
More formatting changes
This commit is contained in:
parent
f9de553621
commit
f125005511
2 changed files with 10 additions and 11 deletions
|
@ -107,7 +107,7 @@ namespace Ryujinx.Common.SystemInfo
|
|||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
using (var process = new Process
|
||||
using var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
|
@ -117,14 +117,12 @@ namespace Ryujinx.Common.SystemInfo
|
|||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true,
|
||||
}
|
||||
})
|
||||
{
|
||||
};
|
||||
process.Start();
|
||||
coreCount = int.Parse(process.StandardOutput.ReadToEnd());
|
||||
process.WaitForExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, $"An error occurred while trying to get the physical core count: {ex.Message}");
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace Ryujinx.Common.SystemInfo
|
|||
int size = Marshal.SizeOf(typeof(SystemLogicalProcessorInformation));
|
||||
for (long offset = 0; offset + size <= buffSize; offset += size)
|
||||
{
|
||||
IntPtr current = new IntPtr(pos + offset);
|
||||
IntPtr current = new(pos + offset);
|
||||
SystemLogicalProcessorInformation info = Marshal.PtrToStructure<SystemLogicalProcessorInformation>(current);
|
||||
|
||||
if (info.Relationship == LogicalProcessorRelationship.RelationProcessorCore)
|
||||
|
@ -98,8 +98,9 @@ namespace Ryujinx.Common.SystemInfo
|
|||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static partial bool GlobalMemoryStatusEx(ref MemoryStatusEx lpBuffer);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool GetLogicalProcessorInformation(IntPtr buffer, ref uint returnLength);
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static partial bool GetLogicalProcessorInformation(IntPtr buffer, ref uint returnLength);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SystemLogicalProcessorInformation
|
||||
|
@ -113,7 +114,7 @@ namespace Ryujinx.Common.SystemInfo
|
|||
public struct ProcessorInformationUnion
|
||||
{
|
||||
[FieldOffset(8)]
|
||||
private UInt64 Reserved2;
|
||||
private readonly UInt64 Reserved2;
|
||||
}
|
||||
|
||||
public enum LogicalProcessorRelationship
|
||||
|
|
Loading…
Reference in a new issue