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

Initial fix for drop #56

Merged
merged 1 commit into from
Mar 1, 2021
Merged

Initial fix for drop #56

merged 1 commit into from
Mar 1, 2021

Conversation

Firstyear
Copy link
Member

Fixes #55. This sets a temporary invalid flag, which if present prevents dropping the cloned values as panic may have occured during the clone.

The reason to leak here is that in order to update the count after each success clone would require a fence to guarantee and prevent code re-ordering of the len set over the other clone calls.

@Firstyear
Copy link
Member Author

passes miri.

@Firstyear
Copy link
Member Author

@ammaraskar can you please review?

@ammaraskar
Copy link

Thanks, this fix looks good to me. The leak tradeoff is probably also fine since this is only really a concern if someone catches the panic.

@Firstyear Firstyear merged commit 1fc9f05 into master Mar 1, 2021
@Firstyear
Copy link
Member Author

Great, thank you!

@Firstyear Firstyear deleted the 55-drop-check branch March 1, 2021 22:53
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.

BptreeMap can drop invalid objects if clone panics
2 participants