Skip to content

Remove once_cell dependency#76

Merged
Amanieu merged 1 commit intoAmanieu:masterfrom
james7132:remove-once-cell-dependency
Apr 25, 2024
Merged

Remove once_cell dependency#76
Amanieu merged 1 commit intoAmanieu:masterfrom
james7132:remove-once-cell-dependency

Conversation

@james7132
Copy link
Copy Markdown
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.

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