Skip to content

Commit

Permalink
Rollup merge of #85550 - pnkfelix:fix-max-rss-division-on-mac, r=Mark…
Browse files Browse the repository at this point in the history
…-Simulacrum

facepalm: operator precedence fail on my part.

This bug was only visible on mac. Also, print_step_rusage is a relatively new
internal feature, that is not heavily used, and has no tests. All of these
factors contributed to how this went uncaught this long. Thanks to Josh Triplett
for pointing it out!
  • Loading branch information
GuillaumeGomez authored May 21, 2021
2 parents 3f0bc5c + b3218d3 commit 9ec88ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ fn format_rusage_data(_child: Child) -> Option<String> {
};
// Mac OS X reports the maxrss in bytes, not kb.
let divisor = if env::consts::OS == "macos" { 1024 } else { 1 };
let maxrss = rusage.ru_maxrss + (divisor - 1) / divisor;
let maxrss = (rusage.ru_maxrss + (divisor - 1)) / divisor;

let mut init_str = format!(
"user: {USER_SEC}.{USER_USEC:03} \
Expand Down

0 comments on commit 9ec88ce

Please sign in to comment.