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

Prevent direct access to s_profiler.

This commit is contained in:
Bartosz Taudul
2019-02-19 18:38:08 +01:00
parent d865d1cc87
commit 2421e05c27
8 changed files with 80 additions and 83 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ class ScopedZone
public:
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, bool is_active = true )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && s_profiler.IsConnected() )
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
@@ -44,7 +44,7 @@ public:
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, int depth, bool is_active = true )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && s_profiler.IsConnected() )
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
@@ -68,7 +68,7 @@ public:
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
tail.store( magic + 1, std::memory_order_release );
s_profiler.SendCallstack( depth, thread );
GetProfiler().SendCallstack( depth, thread );
}
tracy_force_inline ~ScopedZone()