embassy icon indicating copy to clipboard operation
embassy copied to clipboard

`zerocopy_channel` fixed channel and borrowed sender/receiver

Open mkj opened this issue 6 months ago • 0 comments

The first commit implements a borrowed sender/receiver for Channel. This allows sending from the Channel itself, and also could be an alternative to MPSC such as in #2322. Currently there isn't any async sender()/receiver() equivalent, since that'd need a bounded number of wakers and seems like complication. The extra bools in the struct don't add any size, the only overhead will be some bit flips on construction/drop.

The second commit allows having a FixedChannel with local storage. I think the use of UnsafeCell is safe, but it would be good if someone with more unsafe experience could take a look over it. new_cloned() name is a bit arbitrary.

mkj avatar Jun 10 '25 10:06 mkj