Refactor offset-allocator to improve readability - #10
Open
patowen wants to merge 13 commits into
Open
Conversation
patowenforce-pushed
the
refactor-for-rust-practices
branch
from
August 22, 2026 04:55
3e4f1c6 to
5a1a110Comparepatowen
commented
Aug 22, 2026
Author
I've updated this PR so that it's actually readable, as well as removing some of the more controversial changes (such as adding the |
patowenforce-pushed
the
refactor-for-rust-practices
branch
from
August 22, 2026 05:05
5a1a110 to
3064f95Comparepatowenforce-pushed
the
refactor-for-rust-practices
branch
from
August 22, 2026 05:05
3064f95 to
2da1cccComparepatowen
marked this pull request as ready for review
August 22, 2026 05:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few months ago, as part of my work on Hypermine, I was looking into this crate as something to potentially use to manage allocations in Vulkan. While evaluating this crate, I studied the code carefully to understand how it worked, and while doing so, I made some rather extensive refactors to make it easier for me to understand this code. Eventually, I was happy enough with the refactors that I was in favor of vendoring this dependency in Hypermine so that I could take advantage of these refactors.
However, it was suggested that I look into trying to contribute my refactor upstream. I was initially hesitant to do so because this crate was meant to be a port of a C++ package, which itself is considered an "early one weekend prototype", and it seemed like this crate is meant to be as faithful to that C++ package as well.
Regardless, I'm submitting this draft PR in case you are interested in seeing what I have, in case such a refactor is worthwhile to have upstream. I've rebased the commit history to hopefully ease reivew.
This PR makes the following changes (which have been separated out by commit):
SmallFloat,BinsMap, andNodeSlabNodeIndex,BinsMap, andNodeSlabPlease let me know if you have any further questions about this PR. I promise that I did not use an LLM to write any of the code in this PR.