-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std: os: Document MemoryMap #10358
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
std: os: Document MemoryMap #10358
Conversation
@@ -913,44 +913,82 @@ pub fn page_size() -> uint { | |||
} | |||
} | |||
|
|||
/// A memory mapped chunk of memory. This is very system-specific and makes no attempt at |
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.
of memory or file?
I think splitting is ok here, considering that there're not much overlaps. |
@indutny the thing is, for code to be portable, it needs conditional compilation if it wants to handle the errors at all besides just ToStr. re-r? @alexcrichton |
MapOffset(uint) | ||
} | ||
|
||
#[cfg(unix)] |
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.
Did this stay here by accident?
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.
Yes, oops.
@alexcrichton fixed |
@@ -973,6 +1010,7 @@ impl to_str::ToStr for MapError { | |||
|
|||
#[cfg(unix)] | |||
impl MemoryMap { | |||
/// Create a new mapping with the given `options`, at least `min_len` bytes long. |
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.
Could you add to this comment saying that the region is unmapped when the MemoryMap
object goes out of scope?
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.
done
On Sat, Nov 9, 2013 at 12:36 AM, Alex Crichton notifications@github.comwrote:
In src/libstd/os.rs:
@@ -973,6 +1010,7 @@ impl to_str::ToStr for MapError {
#[cfg(unix)]
impl MemoryMap {
- /// Create a new mapping with the given
options
, at leastmin_len
bytes long.Could you add to this comment saying that the region is unmapped when the
MemoryMap object goes out of scope?—
Reply to this email directly or view it on GitHubhttps://github.com//pull/10358/files#r7544673
.
r=me with the commits squashed into one |
Add `unnecessary_literal_unwrap` lint Add lint for more unnecessary unwraps and suggest fixes for them. Fixes rust-lang#10352 - [x] Followed [lint naming conventions][lint_naming] - [x] Added passing UI tests (including committed `.stderr` file) - [x] `cargo test` passes locally - [x] Executed `cargo dev update_lints` - [x] Added lint documentation - [x] Run `cargo dev fmt` r? `@llogiq` --- changelog: New lint [`unnecessary_literal_unwrap`] [rust-lang#10358](rust-lang/rust-clippy#10358) <!-- changelog_checked -->
No description provided.