-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
cordyceps: List
doesn't impl Drop
#165
Comments
as we discussed on discord, it's the element owning the entry that's responsible for dropping it, rather than the list. |
hawkw
added a commit
that referenced
this issue
Jun 7, 2022
When a linked list's `Handle` type owns the allocation for the item in the list, it is necessary to drain all entries from the list and drop them when the `List` instance is dropped. Otherwise, the entries may be leaked. This fixes a leak reported by Miri. Fixes #165 BREAKING CHANGE: The `List::new` constructor now requires a `T: Linked<list::Links<T>>` bound.
hawkw
added a commit
that referenced
this issue
Jun 7, 2022
When a linked list's `Handle` type owns the allocation for the item in the list, it is necessary to drain all entries from the list and drop them when the `List` instance is dropped. Otherwise, the entries may be leaked. This fixes a leak reported by Miri. Fixes #165 BREAKING CHANGE: The `List::new` constructor now requires a `T: Linked<list::Links<T>>` bound.
hawkw
added a commit
that referenced
this issue
Jun 7, 2022
When a linked list's `Handle` type owns the allocation for the item in the list, it is necessary to drain all entries from the list and drop them when the `List` instance is dropped. Otherwise, the entries may be leaked. This fixes a leak reported by Miri. Fixes #165 BREAKING CHANGE: The `List::new` constructor now requires a `T: Linked<list::Links<T>>` bound.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As noticed while troubleshooting CI issues in #163,
cordyceps::List
does not implement Drop, meaning any items contained in that list at the time of the List falling out of scope will be permanently lost.Additionally, the
Entry
type used for tests (including loom and miri tests) also does not implement drop, meaning that even if the LIST drops all of it's contained items, the individual items will likely be leaked.Warning to Eliza: James may not actually understand how the List or List tests work, and the fact you store all the entries in a vec:
means that they all get dropped, and it doesn't matter that List doesn't impl drop.
Have a think about this after some coffee, and potentially close this issue if everything is working as expected.
The text was updated successfully, but these errors were encountered: