mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Messages are also safe.
This commit is contained in:
parent
e80c677fa0
commit
b1a71174db
@ -184,7 +184,9 @@ public:
|
|||||||
|
|
||||||
static tracy_force_inline void Message( const char* txt, size_t size )
|
static tracy_force_inline void Message( const char* txt, size_t size )
|
||||||
{
|
{
|
||||||
#ifndef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
|
if( !s_profiler.IsConnected() ) return;
|
||||||
|
#endif
|
||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto ptr = (char*)tracy_malloc( size+1 );
|
auto ptr = (char*)tracy_malloc( size+1 );
|
||||||
@ -197,12 +199,13 @@ public:
|
|||||||
MemWrite( &item->message.thread, GetThreadHandle() );
|
MemWrite( &item->message.thread, GetThreadHandle() );
|
||||||
MemWrite( &item->message.text, (uint64_t)ptr );
|
MemWrite( &item->message.text, (uint64_t)ptr );
|
||||||
tail.store( magic + 1, std::memory_order_release );
|
tail.store( magic + 1, std::memory_order_release );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void Message( const char* txt )
|
static tracy_force_inline void Message( const char* txt )
|
||||||
{
|
{
|
||||||
#ifndef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
|
if( !s_profiler.IsConnected() ) return;
|
||||||
|
#endif
|
||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
@ -212,7 +215,6 @@ public:
|
|||||||
MemWrite( &item->message.thread, GetThreadHandle() );
|
MemWrite( &item->message.thread, GetThreadHandle() );
|
||||||
MemWrite( &item->message.text, (uint64_t)txt );
|
MemWrite( &item->message.text, (uint64_t)txt );
|
||||||
tail.store( magic + 1, std::memory_order_release );
|
tail.store( magic + 1, std::memory_order_release );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemAlloc( const void* ptr, size_t size )
|
static tracy_force_inline void MemAlloc( const void* ptr, size_t size )
|
||||||
|
Loading…
Reference in New Issue
Block a user