Skip to content

feat: Add extra-platforms feature for non-atomic targets#70

Open
ericschaal wants to merge 1 commit intofaern:mainfrom
ericschaal:portable_atomic
Open

feat: Add extra-platforms feature for non-atomic targets#70
ericschaal wants to merge 1 commit intofaern:mainfrom
ericschaal:portable_atomic

Conversation

@ericschaal
Copy link

@ericschaal ericschaal commented Oct 31, 2025

Introduce a new Cargo feature, extra-platforms, to add support for hardware targets that lack native atomic CAS operations.

The library relies on AtomicU8, which is not available on all platforms (e.g., certain embedded targets like riscv32i or thumbv6m). This prevents the crate from being used in those environments.

This change "poly-fills" the required atomic types by adding an optional dependency on the portable-atomic crate.

I'm using a similar approach to the bytes crate.

@faern
Copy link
Owner

faern commented Feb 23, 2026

This sounds good to me! Sorry for the slow review. Would you be willing to rebase this to resolve the conflicts? Primarily the imports moved to a dedicated atomic.rs now

@ericschaal ericschaal force-pushed the portable_atomic branch 2 times, most recently from e88097d to 89895fb Compare February 24, 2026 16:03
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.

2 participants