Skip to content

reduce the size of arcs from 2 words to 1 #8867

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

Closed
wants to merge 1 commit into from
Closed

reduce the size of arcs from 2 words to 1 #8867

wants to merge 1 commit into from

Conversation

thestinger
Copy link
Contributor

No description provided.

@@ -221,8 +222,9 @@ impl<T: Send> Clone for UnsafeArc<T> {
impl<T> Drop for UnsafeArc<T>{
fn drop(&self) {
unsafe {
// Happens when destructing an unwrapper's handle and from `#[unsafe_no_drop_flag]`
if self.data.is_null() {
Copy link
Member

Choose a reason for hiding this comment

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

Looking at this, where is self.data set to null? I don't remember if destructors zero out the whole structure or just the drop flag, but it seems like without the drop flag this could be run twice and self.data is non-null both times?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you use #[unsafe_no_drop_flag], it zeroes the whole structure instead of the drop flag. That's how it's defined, or it wouldn't be useful.

Copy link
Member

Choose a reason for hiding this comment

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

Ah that makes sense.

@bors bors closed this Aug 30, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 4, 2022
…=flip1995

Set correct `ParamEnv` for `derive_partial_eq_without_eq`

fixes rust-lang#8867

changelog: Handle differing predicates applied by `#[derive(PartialEq)]` and `#[derive(Eq)]` in `derive_partial_eq_without_eq`
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.

3 participants