Skip to content

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

Merged
merged 1 commit into from
Nov 9, 2013
Merged

std: os: Document MemoryMap #10358

merged 1 commit into from
Nov 9, 2013

Conversation

emberian
Copy link
Member

@emberian emberian commented Nov 8, 2013

No description provided.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of memory or file?

@indutny
Copy link
Contributor

indutny commented Nov 8, 2013

I think splitting is ok here, considering that there're not much overlaps.

@emberian
Copy link
Member Author

emberian commented Nov 9, 2013

@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)]
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, oops.

@emberian
Copy link
Member Author

emberian commented Nov 9, 2013

@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.
Copy link
Member

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?

Copy link
Member Author

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 least min_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
.

@alexcrichton
Copy link
Member

r=me with the commits squashed into one

bors added a commit that referenced this pull request Nov 9, 2013
@bors bors closed this Nov 9, 2013
@bors bors merged commit 658e20e into rust-lang:master Nov 9, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants