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

Remove once_cell dependency #76

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Remove once_cell dependency #76

merged 1 commit into from
Apr 25, 2024

Conversation

james7132
Copy link
Contributor

@james7132 james7132 commented Apr 23, 2024

Fixes #50. Avoids the OnceCell by making ThreadIdManager const-initializable. This doesn't require a MSRV bump as aggressive as #64, as it only requires 1.63 to make Mutex::new const. Unfortunately BinaryHeap::new is still not const, so this PR wraps the freelist in an Option to allow initializing it to zero. It should still be cheaper than the atomic check of a Lazy, and this is only done when new threads are registered.

@Amanieu Amanieu merged commit b5aa929 into Amanieu:master Apr 25, 2024
2 checks passed
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.

Swap to using std's OnceCell once stablized
2 participants