-
Notifications
You must be signed in to change notification settings - Fork 2
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
grow_to function assumes final free range is at the end of the overall range #1
Comments
I might actually be hitting this too - would you be willing to submit a PR, possibly with a test to make sure this doesn't come back? |
I just ran into the exact same issue, could have saved some time by looking here first I've created a pull request with essentially the fix proposed by @johnnyrockett (just replacing the second if with same body by using Option::filter) and two test cases for a hole at the beginning and a hole in the middle of allocations: #2 |
Ah. Could this be the cause of |
I've built Rend3 and my Sharpview metaverse viewer using this fix. Overrode range-alloc in crates.io with trunk from github. So far, this seems to have fixed BVE-Reborn/rend3#546 I've been running a test for eight hours now without a failure. |
This looks good. Please bump version number and push to crates.io. Thanks. |
I ran into crashes when freeing ranges and tracked it down to a bug in the grow_to function.
If there is still a free range of memory, this code assumes that it is at the end of the overall range and edits its end to be the new grown end. However, if the last span of freed memory isn't at the very end of the overall range, this will effectively free all the allocated memory in between the last freed span of memory and the end of the overall range.
Something like this change would fix the bug:
The text was updated successfully, but these errors were encountered: