| ... | @@ -122,7 +122,7 @@ pub const ResourceUsageStatistics = struct { | ... | @@ -122,7 +122,7 @@ pub const ResourceUsageStatistics = struct { |
| 122 | /// if available. | 122 | /// if available. |
| 123 | pub inline fn getMaxRss(rus: ResourceUsageStatistics) ?usize { | 123 | pub inline fn getMaxRss(rus: ResourceUsageStatistics) ?usize { |
| 124 | switch (native_os) { | 124 | switch (native_os) { |
| 125 | .linux => { | 125 | .freebsd, .illumos, .linux, .serenity => { |
| 126 | if (rus.rusage) |ru| { | 126 | if (rus.rusage) |ru| { |
| 127 | return @as(usize, @intCast(ru.maxrss)) * 1024; | 127 | return @as(usize, @intCast(ru.maxrss)) * 1024; |
| 128 | } else { | 128 | } else { |
| ... | @@ -149,7 +149,18 @@ pub const ResourceUsageStatistics = struct { | ... | @@ -149,7 +149,18 @@ pub const ResourceUsageStatistics = struct { |
| 149 | } | 149 | } |
| 150 | | 150 | |
| 151 | const rusage_init = switch (native_os) { | 151 | const rusage_init = switch (native_os) { |
| 152 | .linux, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => @as(?posix.rusage, null), | 152 | .freebsd, |
| | 153 | .illumos, |
| | 154 | .linux, |
| | 155 | .serenity, |
| | 156 | .driverkit, |
| | 157 | .ios, |
| | 158 | .maccatalyst, |
| | 159 | .macos, |
| | 160 | .tvos, |
| | 161 | .visionos, |
| | 162 | .watchos, |
| | 163 | => @as(?posix.rusage, null), |
| 153 | .windows => @as(?windows.VM_COUNTERS, null), | 164 | .windows => @as(?windows.VM_COUNTERS, null), |
| 154 | else => {}, | 165 | else => {}, |
| 155 | }; | 166 | }; |
| ... | @@ -486,7 +497,18 @@ fn waitUnwrappedPosix(self: *ChildProcess) void { | ... | @@ -486,7 +497,18 @@ fn waitUnwrappedPosix(self: *ChildProcess) void { |
| 486 | const res: posix.WaitPidResult = res: { | 497 | const res: posix.WaitPidResult = res: { |
| 487 | if (self.request_resource_usage_statistics) { | 498 | if (self.request_resource_usage_statistics) { |
| 488 | switch (native_os) { | 499 | switch (native_os) { |
| 489 | .linux, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => { | 500 | .freebsd, |
| | 501 | .illumos, |
| | 502 | .linux, |
| | 503 | .serenity, |
| | 504 | .driverkit, |
| | 505 | .ios, |
| | 506 | .maccatalyst, |
| | 507 | .macos, |
| | 508 | .tvos, |
| | 509 | .visionos, |
| | 510 | .watchos, |
| | 511 | => { |
| 490 | var ru: posix.rusage = undefined; | 512 | var ru: posix.rusage = undefined; |
| 491 | const res = posix.wait4(self.id, 0, &ru); | 513 | const res = posix.wait4(self.id, 0, &ru); |
| 492 | self.resource_usage_statistics.rusage = ru; | 514 | self.resource_usage_statistics.rusage = ru; |