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

Pack time and source location in LockEvent.

This commit is contained in:
Bartosz Taudul
2019-08-15 20:39:16 +02:00
parent 2e31c26ae5
commit 5e20b3f28a
3 changed files with 83 additions and 57 deletions
+19 -2
View File
@@ -120,8 +120,25 @@ struct LockEvent
ReleaseShared
};
int64_t time;
int16_t srcloc;
int64_t Time() const
{
return int64_t( _start_time ) >> 16;
}
void SetTime( int64_t time )
{
assert( time < ( 1ll << 47 ) );
_start_time = ( _start_time & 0xFFFF ) | ( time << 16 );
}
int16_t SrcLoc() const
{
return int16_t( _start_time & 0xFFFF );
}
void SetSrcLoc( int16_t srcloc )
{
_start_time = ( _start_time & 0xFFFFFFFFFFFF0000 ) | srcloc;
}
uint64_t _start_time;
uint8_t thread;
Type type;
};