-
Notifications
You must be signed in to change notification settings - Fork 482
rust: update Ref to use the kernel's refcount_t.
#377
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| const_panic, | ||
| const_raw_ptr_deref, | ||
| const_unreachable_unchecked, | ||
| receiver_trait, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feature is not meant to eventually be stabilized. It doesn't have a tracking issue and
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we are going to have a in-tree copy of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add some more context to what Gary already said: we had a technical meeting on the A replacement for |
||
| try_reserve | ||
| )] | ||
| #![deny(clippy::complexity)] | ||
|
|
||
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.
Is the support for an initialization closure only there to support easy initialization of
Pinned structures? Or do you believe it's more generally useful? Just asking out of general interest.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.
See wedsonaf@61397b0 -- this allows us to obviate
get_mut, which allows us to safely claim thatRefis in fact pinned.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.
Ah I see ! Yes, getting rid of
get_mut()looks very good. Not sure why you'd need amutclosure for initialization, though?Arcalso provides shared references only, but we are still able to initialize theMutexes inside of it?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.
See wedsonaf@e201bf1 -- allowing
initon just&self(as opposed to&mut self) was an oversight that leads to unsafety (e.g., someone callinginiton a synchronisation primitive that is in use).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.
Holy smoke! I was already wondering about that, but I'm coming from profound ignorance on
Pinning and everything around it.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.
The best way to avoid
get_mutis through a wrapper type likeUniqueArchttps://doc.servo.org/servo_arc/struct.UniqueArc.htmlThere 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.
PS do we have an Issue to keep track of this?
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.
Nice, I like it.
Something for another PR though. (The reason I'm removing
get_mutin this PR is that we don't have arefcount_tfunction with the right barriers forget_mutand I want this code to be simple wrappers aroundrefcount_t).I don't think so. Feel free to open one.