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

Document what we do about unwinding and leaks #22

Open
KodrAus opened this issue Feb 12, 2021 · 2 comments
Open

Document what we do about unwinding and leaks #22

KodrAus opened this issue Feb 12, 2021 · 2 comments

Comments

@KodrAus
Copy link
Contributor

KodrAus commented Feb 12, 2021

In rust-lang/rust#67290 we added drop guards to collections that will attempt to continue dropping in case dropping an item unwinds. That means collections will either not leak if an item unwinds during drop, or will abort.

In rust-lang/rust#75644 we've looked at preventing leaks if an unwind happens partway through initializing a MaybeUninit (usually for arrays).

We should come up with some concrete guidance on how we want to deal with leaks and unwinding

@the8472
Copy link
Member

the8472 commented Apr 10, 2021

Has the perf impact of this been considered? I suspect that the necessary additional loops are not exactly zero-cost. I clicked through the linked issue and as far as I can tell there's not really a motivating statement why this should be done. The thing that started it was merely the finding that there are some leaks after panic-during-drop, but no discussion why that should be changed.

@KodrAus
Copy link
Contributor Author

KodrAus commented Nov 26, 2021

@the8472 Hmm, I don't remember what consideration it had, but I think avoiding leaks where possible is important to keep a healthy runtime. The performance impact is still important, but secondary to that.

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

No branches or pull requests

2 participants