-
Notifications
You must be signed in to change notification settings - Fork 702
sys::resource update max_rss accessor doc to reflect the unit per platform #2333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/sys/resource.rs
Outdated
#[cfg(not(apple_targets))] | ||
return self.0.ru_maxrss; | ||
#[cfg(apple_targets)] | ||
return self.0.ru_maxrss >> 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about updating the doc on apple_targets
rather than tweaking the code so that we can be more resilient to this kind of changes:
/// The resident set size at its peak,
#[cfg_attr(apple_targets, doc = " in bytes.")]
#[cfg_attr(not(apple_targets), doc = "in kilobytes.")]
pub fn max_rss(&self) -> c_long {
self.0.ru_maxrss
3277ffc
to
599550b
Compare
src/sys/resource.rs
Outdated
@@ -293,7 +293,9 @@ impl Usage { | |||
TimeVal::from(self.0.ru_stime) | |||
} | |||
|
|||
/// The resident set size at its peak, in kilobytes. | |||
/// /// The resident set size at its peak, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be redundant:
/// /// The resident set size at its peak, | |
/// The resident set size at its peak, |
src/sys/resource.rs
Outdated
/// The resident set size at its peak, in kilobytes. | ||
/// /// The resident set size at its peak, | ||
#[cfg_attr(apple_targets, doc = " in bytes.")] | ||
#[cfg_attr(not(apple_targets), doc = "in kilobytes.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: might be better to have a space here:
#[cfg_attr(not(apple_targets), doc = "in kilobytes.")] | |
#[cfg_attr(not(apple_targets), doc = " in kilobytes.")] |
599550b
to
748a0d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Are you willing to update the PR title since Nix's merge queue uses squash merge, the PR title will be used as the commit message
on Apple's devices. this field returns the value in byte. close #2331