| 217 | } |
| 218 | |
| 219 | EIGEN_ALWAYS_INLINE |
| 220 | unsigned CalculateSize(unsigned front, unsigned back) const { |
| 221 | int size = (front & kMask2) - (back & kMask2); |
| 222 | // Fix overflow. |
| 223 | if (size < 0) size += 2 * kSize; |
| 224 | // Order of modification in push/pop is crafted to make the queue look |
| 225 | // larger than it is during concurrent modifications. E.g. push can |
| 226 | // increment size before the corresponding pop has decremented it. |
| 227 | // So the computed size can be up to kSize + 1, fix it. |
| 228 | if (size > static_cast<int>(kSize)) size = kSize; |
| 229 | return static_cast<unsigned>(size); |
| 230 | } |
| 231 | |
| 232 | RunQueue(const RunQueue&) = delete; |
| 233 | void operator=(const RunQueue&) = delete; |
nothing calls this directly
no outgoing calls
no test coverage detected