-
Notifications
You must be signed in to change notification settings - Fork 109
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
Bump
not respecting allocation limit set
#244
Comments
Thanks for filing an issue. That example is setting the allocation limit after allocating a chunk. But the allocated chunk could have been with a little more capacity than requested for a variety of reasons, so you might already have more capacity than the limit by the time you set the limit. Note that the
So if you set the limit and then allocate, you should run into the limit and start getting allocation failures. |
Ah, thanks! :) Is there anyway I can reserve capacity after initialization? (Similar to |
Not really after you've already allocated, because if there isn't enough capacity in the current chunk to satisfy the reservation request, we can't resize the current chunk that the If you wanted to pre-allocate space for one big chunk, you could do something like
FWIW, you can check the remaining capacity in the chunk via But yeah, to sum up: there isn't a simple general solution here, the way there is for |
To be clear, my usage in specific is using But I understand your point, thanks! (I might try out |
Hello \o/
https://www.rustexplorer.com/b#LyoKW2RlcGVuZGVuY2llc10KYnVtcGFsbyA9ICIqIgoqLwoKdXNlIGJ1bXBhbG86OkJ1bXA7CgpmbiBtYWluKCkgewogICAgbGV0IHggPSBCdW1wOjp3aXRoX2NhcGFjaXR5KDE2Mzg0KTsKICAgIHguc2V0X2FsbG9jYXRpb25fbGltaXQoU29tZSgxNjM4NCkpOwoKICAgIGZvciBpIGluIDAuLjIwXzAwMHUzMiB7CiAgICAgICAgeC5hbGxvYyhpKTsKICAgIH0KCiAgICBkYmchKHguYWxsb2NhdGVkX2J5dGVzKCkpOwp9
I am currently trying out the
set_allocation_limit
API ofBump
— Perhaps I'm misunderstanding how it affects the arena, but the limit seems to be completely ignored? I'd really appreciate some help on this! <3The text was updated successfully, but these errors were encountered: