Allow move-only types in UnboundedMPSCQueue
Categories
(Core :: Audio/Video: MediaStreamGraph, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: jari, Assigned: jari)
References
(Blocks 1 open bug)
Details
Attachments
(2 external files)
The file dom/media/UnboundedMessageQueue.h contains one of the multiple producers, single consumer queue implementations in Gecko. It is generic so that technically it could be widely used but unfortunately it requires the data type to be copyable.
If the assignment of the data to the output value on pop were changed to use std::move then the queue could also be used for move-only types, and we could avoid the proliferation of MPSC queues without fundamental differences.
| Assignee | ||
Comment 1•9 months ago
|
||
Seems like not much is breaking if we just use move. The comment right after the change says that the data of next would have been stale anyways so why not avoid the copy? A possible downside is that T would need a move assignment operator, and while not having one is often a circumstance of historical or unintentional origin, for the cases where copy is truly needed, there could be an assignment-performing wrapper which by default does a move and for the specific overloads does the copy.
| Assignee | ||
Comment 2•8 months ago
|
||
Updated•8 months ago
|
| Assignee | ||
Comment 3•8 months ago
|
||
Comment 5•8 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e3e8aaa3ad5c
https://hg.mozilla.org/mozilla-central/rev/fb1b5415d8b6
Updated•7 months ago
|
Description
•