-
Notifications
You must be signed in to change notification settings - Fork 119
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
Question: Is it okay for Bump::grow to only receive a new_size, but not the entire new_layout? #143
Comments
@yanchith thanks for filing an issue! Yes, I think that Would you be up for making these changes and sending a pull request? |
If you mean just the lazy version of returning Btw are you privy to what lead to the decision of letting the caller request a different alignment when growing/shrinking in the allocator api? |
That's a good place to start, but it shouldn't be hard to add the more general support (just call
I am not. Might be worth bringing up with the |
FYI I asked around and got pointed here regarding the design history: rust-lang/wg-allocators#5 |
I think we can now close this - feel free reopen if you want this for documentation. |
Was doing some relaxing reading of bumpalo's source (commit b22416c) when I found the following:
Allocator::grow
receivesnew_layout
, but the Allocator trait impl in bumpalo only passesnew_size
toBump::grow
.What happens, if
Allocator::grow
gets called with a new layout that has a greater alignment requirement? Docs ofAllocator::grow
say:So I guess it would be ok to return
AllocError
if the alignment requirements got stricter with the new layout, but the trait impl currently ignores that.I also could be missing something 😂
The text was updated successfully, but these errors were encountered: