| author | |
| committer | |
| log | 224fca7e0e1cfe1bf27178ecb4e53d4f88fb9abf |
| tree | 6a896e02dc8412d396da2f3cb4d798e2d308cf2d |
| parent | 2b73c28cec9a5c75ab064f1ebd88b12aa64d22dd |
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; |