| 112 | node* tail_copy_; // helper (points somewhere between first_ and tail_) |
| 113 | |
| 114 | node* alloc_node() |
| 115 | { |
| 116 | // first tries to allocate node from internal node cache, |
| 117 | // if attempt fails, allocates node via ::operator new() |
| 118 | |
| 119 | if (first_ != tail_copy_) |
| 120 | { |
| 121 | node* n = first_; |
| 122 | first_ = first_->next_; |
| 123 | return n; |
| 124 | } |
| 125 | tail_copy_ = load_consume(&tail_); |
| 126 | if (first_ != tail_copy_) |
| 127 | { |
| 128 | node* n = first_; |
| 129 | first_ = first_->next_; |
| 130 | return n; |
| 131 | } |
| 132 | node* n = new node; |
| 133 | return n; |
| 134 | } |
| 135 | |
| 136 | spsc_queue(spsc_queue const&); |
| 137 | spsc_queue& operator = (spsc_queue const&); |
nothing calls this directly
no test coverage detected