The MpMcQueue drop implementation is not optimized, as it uses the normal dequeue method, which assumes a shared reference and prevents race condition. drop gives us a mutable reference, which means that the implementation could skip the atomic operations, and all the care for synchronization.
The
MpMcQueue
drop implementation is not optimized, as it uses the normaldequeue
method, which assumes a shared reference and prevents race condition.drop
gives us a mutable reference, which means that the implementation could skip the atomic operations, and all the care for synchronization.See https://github.com/rust-embedded/heapless/pull/483#discussion_r1657140475