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

Abort on root count overflows #35

Merged
merged 1 commit into from
Aug 7, 2016
Merged

Abort on root count overflows #35

merged 1 commit into from
Aug 7, 2016

Conversation

apasel422
Copy link
Contributor

Closes #34

self.header.roots.set(self.header.roots.get() + 1);
// abort if the count overflows to prevent `mem::forget` loops that could otherwise lead to
// erroneous drops
self.header.roots.set(self.header.roots.get()
Copy link
Owner

Choose a reason for hiding this comment

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

Panic should be ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I was just copying the behavior of {Arc, Rc}.

@Manishearth
Copy link
Owner

Fair. If they abort we should too.

@Manishearth Manishearth merged commit 93a102a into Manishearth:master Aug 7, 2016
@apasel422 apasel422 deleted the overflow branch August 7, 2016 13:04
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.

2 participants