| author | |
| committer | |
| log | cbc3c0dc594341faddb8841fb466254f2f6f3b35 |
| tree | c6b1cad4c05267292e204ba62005b32e2e05f708 |
| parent | cb9821a827f972252f8c02775bd2df07435f04c6 |
| signature |
Fixes #250381 files changed, 2 insertions(+), 1 deletions(-)
lib/std/process.zig+2-1| ... | ... | @@ -1753,7 +1753,8 @@ pub fn totalSystemMemory() TotalSystemMemoryError!u64 { |
| 1753 | 1753 | if (std.os.linux.E.init(result) != .SUCCESS) { |
| 1754 | 1754 | return error.UnknownTotalSystemMemory; |
| 1755 | 1755 | } |
| 1756 | return info.totalram * info.mem_unit; | |
| 1756 | // Promote to u64 to avoid overflow on systems where info.totalram is a 32-bit usize | |
| 1757 | return @as(u64, info.totalram) * info.mem_unit; | |
| 1757 | 1758 | }, |
| 1758 | 1759 | .freebsd => { |
| 1759 | 1760 | var physmem: c_ulong = undefined; |