-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow usage on no_std
targets and targets using portable-atomic
#7
Conversation
The atomic-polyfill and the feature-based approach it recommends can very easily introduce unsoundness when the dependency enables that feature. (Even if they no longer provide a default implementation, even if they warn about it in their documentation. -- I have seen many libraries in the async ecosystem where the similar feature to select TLS or runtime is enabled by default or always enabled. So, I believe that such an approach is fundamentally fragile.) See also mvdnes/spin-rs#114 and tokio-rs/bytes#461 (comment). |
I see that in the issues you linked |
Yeah, I'm fine with that. |
no_std
targets and targets using atomic-polyfill
no_std
targets and targets using portable-atomic
I've ported this code to use |
I just added a check to the CI that builds on a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This pull requests replaces this crate's dependency on
libstd
withlibcore
, allowing it to be used onno_std
targets. In addition, it adds a feature calledatomic-polyfill
, which uses the crate of the same name to provideAtomicUsize
onno_std
targets.