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

Avoid excessive stack operations for cpu query.

This commit is contained in:
Bartosz Taudul
2017-10-10 23:21:30 +02:00
parent 75457c1465
commit cc8b357f09
5 changed files with 18 additions and 20 deletions
+4 -2
View File
@@ -446,7 +446,8 @@ void View::ProcessZoneBegin( const QueueZoneBegin& ev )
zone->start = ev.time * m_timerMul;
zone->end = -1;
zone->srcloc = ev.srcloc;
zone->cpu_start = ev.cpu;
assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() );
zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu;
zone->text = nullptr;
std::unique_lock<std::mutex> lock( m_lock );
@@ -464,7 +465,8 @@ void View::ProcessZoneEnd( const QueueZoneEnd& ev )
assert( zone->end == -1 );
std::unique_lock<std::mutex> lock( m_lock );
zone->end = ev.time * m_timerMul;
zone->cpu_end = ev.cpu;
assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() );
zone->cpu_end = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu;
lock.unlock();
assert( zone->end >= zone->start );
UpdateZone( zone );