Merge remote-tracking branch 'origin/master' into llvm16

This commit is contained in:
Andrew Kelley 2023-04-06 13:58:54 -07:00
commit 9f957184a1

View File

@ -1164,7 +1164,8 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize {
},
.windows => {
var kilobytes: std.os.windows.ULONGLONG = undefined;
assert(std.os.windows.kernel32.GetPhysicallyInstalledSystemMemory(&kilobytes) == std.os.windows.TRUE);
if (std.os.windows.kernel32.GetPhysicallyInstalledSystemMemory(&kilobytes) != std.os.windows.TRUE)
return error.UnknownTotalSystemMemory;
return kilobytes * 1024;
},
else => return error.UnknownTotalSystemMemory,