File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,7 +555,7 @@ class LockFreeSpscQueue
555555 size_t available_items
556556 = m_consumer_data.cached_write_pos - current_read_pos;
557557
558- if (available_items < num_items_to_read) {
558+ if (available_items < num_items_to_read) [[unlikely]] {
559559 // "Slow path": our cache is out of date.
560560 // Perform an expensive acquire load to get the true position from the producer.
561561 m_consumer_data.cached_write_pos
@@ -713,7 +713,7 @@ class LockFreeSpscQueue
713713 // 64-bit indices wrap around, due to the defined behavior of unsigned
714714 // integer arithmetic.
715715
716- if (available_space < num_items_to_write) {
716+ if (available_space < num_items_to_write) [[unlikely]] {
717717 // "Slow path": our cache is out of date.
718718 // Perform an expensive acquire load to get the true position from the consumer.
719719 m_producer_data.cached_read_pos
You can’t perform that action at this time.
0 commit comments