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

Disallow direct access to s_token.

This commit is contained in:
Bartosz Taudul
2019-02-19 18:27:00 +01:00
parent 44753dd4ac
commit d865d1cc87
8 changed files with 66 additions and 68 deletions
+5 -5
View File
@@ -26,7 +26,7 @@ public:
const auto thread = GetThreadHandle();
m_thread = thread;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
@@ -53,7 +53,7 @@ public:
const auto thread = GetThreadHandle();
m_thread = thread;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::ZoneBeginCallstack );
@@ -75,7 +75,7 @@ public:
{
if( !m_active ) return;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
@@ -94,7 +94,7 @@ public:
{
if( !m_active ) return;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
@@ -110,7 +110,7 @@ public:
{
if( !m_active ) return;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';