-
Notifications
You must be signed in to change notification settings - Fork 112
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
Pinning bumpalo::boxed::Box
is unsound
#186
Comments
Probably should just remove the |
That would be a reasonable solution! The best option for keeping |
This combined with #204 makes me think we want two box types; a |
A pinned
bumpalo::boxed::Box
might not upholdPin
's Drop guarantee. Specifically if a pinnedbumpalo::boxed::Box
is forgotten then the memory backing it might still be freed. (This differs from how std::boxed::Box is implemented.)To soundly give out pinned references from a
Bump
one could keep a counter of the number of pinned allocations that still need to be freed and if that counter isn't zero whenBump
is dropped then it could leak all of its memory. However decrementing this counter when aBox
is dropped would requirebumpalo::boxed::Box
to store a reference toBump
which would double theBox
's size (two pointers).The text was updated successfully, but these errors were encountered: