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:
parent
1aaab3c5e4
commit
7f36bb6846
@ -1970,13 +1970,10 @@ private:
|
|||||||
tracy_force_inline T* enqueue_begin(index_t& currentTailIndex)
|
tracy_force_inline T* enqueue_begin(index_t& currentTailIndex)
|
||||||
{
|
{
|
||||||
currentTailIndex = this->tailIndex.load(std::memory_order_relaxed);
|
currentTailIndex = this->tailIndex.load(std::memory_order_relaxed);
|
||||||
if ((currentTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) != 0) {
|
if (details::unlikely((currentTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) == 0)) {
|
||||||
return (*this->tailBlock)[currentTailIndex];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this->enqueue_begin_alloc<allocMode>(currentTailIndex);
|
this->enqueue_begin_alloc<allocMode>(currentTailIndex);
|
||||||
return (*this->tailBlock)[currentTailIndex];
|
|
||||||
}
|
}
|
||||||
|
return (*this->tailBlock)[currentTailIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
tracy_force_inline std::atomic<index_t>& get_tail_index()
|
tracy_force_inline std::atomic<index_t>& get_tail_index()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user