Skip to content

Commit 70d1bb8

Browse files
committed
Revert "std.process: further totalSystemMemory portage"
This reverts commit 5c70d7b.
1 parent c6ec217 commit 70d1bb8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/std/process.zig

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,17 +1163,12 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize {
11631163
.linux => {
11641164
return totalSystemMemoryLinux() catch return error.UnknownTotalSystemMemory;
11651165
},
1166-
.freebsd, .netbsd, .dragonfly, .macos => {
1166+
.freebsd => {
11671167
var physmem: c_ulong = undefined;
11681168
var len: usize = @sizeOf(c_ulong);
1169-
const name = switch (builtin.os.tag) {
1170-
.macos => "hw.memsize",
1171-
.netbsd => "hw.physmem64",
1172-
else => "hw.physmem",
1173-
};
1174-
os.sysctlbynameZ(name, &physmem, &len, null, 0) catch |err| switch (err) {
1169+
os.sysctlbynameZ("hw.physmem", &physmem, &len, null, 0) catch |err| switch (err) {
11751170
error.NameTooLong, error.UnknownName => unreachable,
1176-
else => return error.UnknownTotalSystemMemory,
1171+
else => |e| return e,
11771172
};
11781173
return @as(usize, @intCast(physmem));
11791174
},

0 commit comments

Comments
 (0)