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

Fix leak of memory if dropping function panic #360

Closed
wants to merge 1 commit into from

Conversation

JustForFun88
Copy link
Contributor

This PR is similar to #348, but we are considering panic during table dropping. If the element from the dropping table panics from its Drop impl, the table will not be deallocated, leading to a memory leak. This pull request fixes that.

@JustForFun88
Copy link
Contributor Author

Looks like fail caused by rust-lang/rust#101474 as mentioned in #359

@Amanieu
Copy link
Member

Amanieu commented Sep 7, 2022

I'm concerned that this increases code size (and thus compilation time) for little benefit: a panic in a Drop usually means that you're going to leak memory anyways. IMO the proper solution is to completely disallow unwinding from Drop (rust-lang/rfcs#3288).

@JustForFun88
Copy link
Contributor Author

I'm concerned that this increases code size (and thus compilation time) for little benefit: a panic in a Drop usually means that you're going to leak memory anyways. IMO the proper solution is to completely disallow unwinding from Drop (rust-lang/rfcs#3288).

Hmm... yes, I think you're right. Complications do not bring any benefit. Closing this pull request.

@JustForFun88 JustForFun88 deleted the fix_leaking branch September 7, 2022 08:18
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