1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Mark unlikely code path.

It also changes MSVC behavior from generating two jumps to just one.
This commit is contained in:
Bartosz Taudul 2017-10-13 20:24:11 +02:00
parent 1aaab3c5e4
commit 7f36bb6846

View File

@ -1970,13 +1970,10 @@ private:
tracy_force_inline T* enqueue_begin(index_t& currentTailIndex)
{
currentTailIndex = this->tailIndex.load(std::memory_order_relaxed);
if ((currentTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) != 0) {
return (*this->tailBlock)[currentTailIndex];
}
else {
if (details::unlikely((currentTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) == 0)) {
this->enqueue_begin_alloc<allocMode>(currentTailIndex);
return (*this->tailBlock)[currentTailIndex];
}
return (*this->tailBlock)[currentTailIndex];
}
tracy_force_inline std::atomic<index_t>& get_tail_index()