Add Tag(u8) newtype in an attempt to stop using byte-pointers for everything #565
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.
The longer-term goal is to make it so that all the pointers passed around inside the are either
Tag
pointers orT
pointers, so that we know whether we're using them for indexing into the control or the buckets. Then,u8
pointers mean that we're referring to a raw allocation, rather than the control bytes.However, the current code isn't really built for this, and the result is a lot of pointer casts everywhere. I didn't want to just replace
u8
withTag
everywhere, since there are some cases where we useu8
to really mean bytes, and that would be counter to the original purpose.One short-term gain, however, is that the constant tags and the various methods on them can now be real associated constants and methods, instead of just standalone functions and constants that have to be imported separately.
This change also bumps MSRV to 1.65.0. I could bump it higher, but only 1.65 was needed, so, I decided to go with the smallest amount.