Skip to content
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

Add Tag(u8) newtype in an attempt to stop using byte-pointers for everything #565

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Oct 3, 2024

The longer-term goal is to make it so that all the pointers passed around inside the are either Tag pointers or T 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 with Tag everywhere, since there are some cases where we use u8 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.

src/raw/mod.rs Outdated Show resolved Hide resolved
@clarfonthey clarfonthey force-pushed the tag-type branch 3 times, most recently from 1b3e166 to 09a4461 Compare October 3, 2024 20:05
@Amanieu
Copy link
Member

Amanieu commented Oct 5, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Oct 5, 2024

📌 Commit 4de01fe has been approved by Amanieu

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 5, 2024

⌛ Testing commit 4de01fe with merge ee00971...

@bors
Copy link
Contributor

bors commented Oct 5, 2024

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing ee00971 to master...

@bors bors merged commit ee00971 into rust-lang:master Oct 5, 2024
24 checks passed
@clarfonthey clarfonthey deleted the tag-type branch October 5, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants