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

Use portable-atomic #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrysn
Copy link

@chrysn chrysn commented Sep 13, 2024

This should not have run-time impact on platforms that support atomic boolean compare-and-swap, but enables its use on microcontrollers where the user configures portable-atomic in such a way that atomics can be emulated (eg. through disabling interrupts).

I have not tested whether portable-atomics works with the 1.31 version tested in CI. Should that fail, should I rather feature-gate this, can we update the MSRV of this crate, or should I hack CI to use an older version of portable-atomics (because Rust 1.31 was way before cargo became rust-version aware)?

This should not have run-time impact on platforms that support atomic
boolean compare-and-swap, but enables its use on microcontrollers where
the user configures portable-atomic in such a way that atomics can be
emulated (eg. through disabling interrupts).
@chrysn
Copy link
Author

chrysn commented Sep 13, 2024

As CI is only run once cleared, I've tested this locally with Rust 1.31. (And found that the minimal version was incorrect, that is now fixed).

Inconveniently, even the oldest usable portable-atomics version (1.3.0) does not work with Rust 1.31.

Is updating the MSRV of this project an option? I haven't bisected, but at least 1.58 works (and works even with portable-atomics 1.70); if we need to stay lower but can move from 1.31, I'm happy to provide a sharper result than "> 1.31 <= 1.58".

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.

1 participant