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

Deallocate BumpVec on drop and into_iter, shrink on into_*slice #33

Merged
merged 6 commits into from
Sep 16, 2024

Conversation

bluurryy
Copy link
Owner

@bluurryy bluurryy commented Sep 15, 2024

Currently BumpVec does not attempt to deallocate on drop nor when calling into_*slice. This is unexpected. This is unlike Vec or MutBumpVec which deallocate on drop (MutBumpVec never actually bumps the pointer).

It's better if it does deallocate and shrink by default. You can still get a slice without any shrinking via into_fixed_vec().into_boxed_slice().

Todo

  • implement a deallocating IntoIter

@bluurryy bluurryy added enhancement New feature or request breaking This is a breaking change labels Sep 15, 2024
@bluurryy bluurryy changed the title Deallocate BumpVec on drop, shrink on into_*slice Deallocate BumpVec on drop and into_iter, shrink on into_*slice Sep 16, 2024
@bluurryy bluurryy merged commit 4c4fc67 into main Sep 16, 2024
6 checks passed
@bluurryy bluurryy deleted the drop-and-shrink-bump-vec branch September 18, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant