feat(cordyceps): Initial support for non-CAS targets#526
feat(cordyceps): Initial support for non-CAS targets#526jamesmunns merged 8 commits intohawkw:mainfrom
Conversation
|
Would you mind elaborating a bit on the rationale for doing this by For the record, I'm not suggesting that just disabling these APIs on non-CAS platforms is the wrong approach, I'm just curious about why it's the right one. My guess is that this is because |
Yep! That's exactly it. A naiive "drop in p-a" impl would be decidedly not-great for all structures, so my plan was to make the current lib build, notching out unsupported structures entirely, then in a second pass/PR, re-implement at least |
|
For what it's worth, For bbq2, I ended up making a separate trait for |
|
Yeah, that makes sense. I'm on board with the initial goal of just getting the crate to build for those targets at all! |
|
@hawkw is this good to merge, or did you want to take another pass on it? |
sorry, i wanted to leave a few suggestions on the feature-flagging implementation. give me a sec! |
hawkw
left a comment
There was a problem hiding this comment.
I had a few minor suggestions on how we could make the cfg-gating a bit more ergonomic for future changes to the cfg-gated structures, and a couple small tweaks to the CI job. Other than that, this looks good!
This PR is a first attempt to allow building of
cordycepson non-CAS enabled targets, such asthumbv6m-none-eabi/Cortex-M0+/rp2040.Doing this as a first feature, prior to implementing a non-atomic and
critical_sectionbased version of TransferStack, in service of embassy-rs/embassy#4035.Rather than making a default-on "CAS" feature, we instead gate on
cfg(target_has_atomic = "ptr"), which was stabilized in 1.60, which currently has the meaning of "this target has CAS". This automatically gates-outTransferStackandMpscQueue, while the "mutable" collections can still be used.Right now the cfg gating is a little scattershot, I wanted to open this to discuss, if you'd like me to clean things up a bit to group the CAS-ful parts, I'm happy to do so.