Prevent inlining next block preparation.

This commit is contained in:
Bartosz Taudul
2020-01-02 23:52:03 +01:00
parent 9b0044838e
commit be5c94ee09
3 changed files with 22 additions and 16 deletions

View File

@@ -23,6 +23,7 @@
#include "common/TracySocket.cpp"
#include "client/tracy_rpmalloc.cpp"
#include "client/TracyDxt1.cpp"
#include "client/TracyLfq.cpp"
#if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
# include "libbacktrace/alloc.cpp"

20
client/TracyLfq.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "TracyLfq.hpp"
namespace tracy
{
LfqBlock* LfqProducerImpl::NextBlock( LfqBlock* tailBlk )
{
auto next = m_queue->GetFreeBlock();
assert( next );
assert( next->next.load() == nullptr );
assert( tailBlk->next.load() == nullptr );
next->thread = m_thread;
tailBlk->next.store( next );
m_tail.store( next );
lfq_dataEnd = next->dataEnd;
lfq_tail = &next->tail;
return next;
}
}

View File

@@ -86,7 +86,7 @@ public:
return tail;
}
inline LfqBlock* NextBlock( LfqBlock* tailBlk );
tracy_no_inline LfqBlock* NextBlock( LfqBlock* tailBlk );
std::atomic<LfqProducerImpl*> m_next;
std::atomic<bool> m_active, m_available;
@@ -346,21 +346,6 @@ tracy_force_inline void LfqProducerImpl::CleanupThread()
m_queue->ReleaseBlocks( blk );
}
inline LfqBlock* LfqProducerImpl::NextBlock( LfqBlock* tailBlk )
{
auto next = m_queue->GetFreeBlock();
assert( next );
assert( next->next.load() == nullptr );
assert( tailBlk->next.load() == nullptr );
next->thread = m_thread;
tailBlk->next.store( next );
m_tail.store( next );
lfq_dataEnd = next->dataEnd;
lfq_tail = &next->tail;
return next;
}
}
#endif