Skip to content
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

Make mmap not use expose semantics #3220

Merged
merged 1 commit into from Dec 18, 2023
Merged

Conversation

saethlin
Copy link
Member

src/shims/unix/mem.rs Outdated Show resolved Hide resolved
}

let len = Size::from_bytes(alloc.len() as u64);
let length = Size::from_bytes(round_to_next_multiple_of(length, this.machine.page_size));
this.deallocate_ptr(
Copy link
Member

Choose a reason for hiding this comment

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

Given that there was quite a bit of discussion that led to this implementation, please add a comment explaining that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I've updated the comment at the top of the module, and also nuked the test that was checking for this. Does that cover your request, or should there be more explanation in munmap itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

I force-pushed to fix the failing tests and didn't comment. So I'm commenting now.

@RalfJung
Copy link
Member

Looks good, thanks. :)
@bors r+

@bors
Copy link
Collaborator

bors commented Dec 18, 2023

📌 Commit ee50c15 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 18, 2023

⌛ Testing commit ee50c15 with merge 7f1e4de...

@bors
Copy link
Collaborator

bors commented Dec 18, 2023

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 7f1e4de to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Dec 18, 2023

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 7f1e4de to master...

@bors bors merged commit 7f1e4de into rust-lang:master Dec 18, 2023
8 checks passed
@saethlin saethlin deleted the strict-mmap branch December 18, 2023 21:47
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.

Unix: munmap emits "warning: integer-to-pointer cast"
3 participants