Skip to content

depend: Update crossbeam-utils to "0.8.9" instead of "=0.8.9" #4293

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

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

discord9
Copy link
Contributor

Because it require Lazy for static (essentially global variable) and after 0.8.9, crossbeam-utils 's AtomicCell can't be use in static anymore, so refactor to wrap them in a Lazy

@qingshi163
Copy link
Contributor

This is adding a overhead for each visit witch is not neccesasy.
Is crossbeam denied to use AtomicCell with static by reason? should we create a pr to crossbeam?

@discord9
Copy link
Contributor Author

discord9 commented Nov 24, 2022

This is adding a overhead for each visit witch is not neccesasy. Is crossbeam denied to use AtomicCell with static by reason? should we create a pr to crossbeam?

According to their comment(https://docs.rs/crossbeam-utils/0.8.10/src/crossbeam_utils/atomic/atomic_cell.rs.html#33-47) in 0.8.10 of crossbeam-utils, yes it seems to have a reason(Not using MaybeUninit is unsound)

    /// Using MaybeUninit to prevent code outside the cell from observing partially initialized state:
    /// <https://github.com/crossbeam-rs/crossbeam/issues/833>

They add a MaybeUninit starting after 0.8.9, this is link to 0.8.9 for comparsion:
https://docs.rs/crossbeam-utils/0.8.9/src/crossbeam_utils/atomic/atomic_cell.rs.html#33-40

@qingshi163
Copy link
Contributor

Ok I see, due to MaybeUninit now crossbeam::AtomicCell has to implement Drop.

Can you create a RFC so we can optimize it in the future?

@discord9
Copy link
Contributor Author

discord9 commented Nov 25, 2022

How about this RFC?
#4295

Ok I see, due to MaybeUninit now crossbeam::AtomicCell has to implement Drop.

Can you create a RFC so we can optimize it in the future?

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