diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2021-05-01 15:32:02 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2021-05-01 15:32:02 +0300 |
commit | a688d24665f8a55371e75f25c80206212574a85e (patch) | |
tree | 1448322242815f08f0f1db791ab36df69ac8c410 /server/TracyEvent.hpp | |
parent | 088dd0619749c775c728b555638c7782e3e472be (diff) |
Replace two memory reads with just one.
Diffstat (limited to 'server/TracyEvent.hpp')
-rw-r--r-- | server/TracyEvent.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 23f876f8..9d9eb4de 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -458,7 +458,7 @@ struct ContextSwitchCpu { tracy_force_inline int64_t Start() const { return int64_t( _start_thread ) >> 16; } tracy_force_inline void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_thread)+2, &start, 4 ); memcpy( ((char*)&_start_thread)+6, ((char*)&start)+4, 2 ); } - tracy_force_inline int64_t End() const { return _end.Val(); } + tracy_force_inline int64_t End() const { int64_t v; memcpy( &v, ((char*)&_end)-2, 8 ); return v >> 16; } tracy_force_inline void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); _end.SetVal( end ); } tracy_force_inline bool IsEndValid() const { return _end.IsNonNegative(); } tracy_force_inline uint16_t Thread() const { return uint16_t( _start_thread ); } |