Directly access memory, omitting shift.

As always, clang generated the right code here anyways...
This commit is contained in:
Bartosz Taudul 2020-02-11 02:24:40 +01:00
parent 5a995d804b
commit caace1ce11

View File

@ -405,7 +405,7 @@ struct ContextSwitchUsage
tracy_force_inline void SetTime( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_other_own)+2, &time, 4 ); memcpy( ((char*)&_time_other_own)+6, ((char*)&time)+4, 2 ); } tracy_force_inline void SetTime( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_other_own)+2, &time, 4 ); memcpy( ((char*)&_time_other_own)+6, ((char*)&time)+4, 2 ); }
tracy_force_inline uint8_t Other() const { return uint8_t( _time_other_own ); } tracy_force_inline uint8_t Other() const { return uint8_t( _time_other_own ); }
tracy_force_inline void SetOther( uint8_t other ) { memcpy( &_time_other_own, &other, 1 ); } tracy_force_inline void SetOther( uint8_t other ) { memcpy( &_time_other_own, &other, 1 ); }
tracy_force_inline uint8_t Own() const { return uint8_t( _time_other_own >> 8 ); } tracy_force_inline uint8_t Own() const { uint8_t v; memcpy( &v, ((char*)&_time_other_own)+1, 1 );return v; }
tracy_force_inline void SetOwn( uint8_t own ) { memcpy( ((char*)&_time_other_own)+1, &own, 1 ); } tracy_force_inline void SetOwn( uint8_t own ) { memcpy( ((char*)&_time_other_own)+1, &own, 1 ); }
uint64_t _time_other_own; uint64_t _time_other_own;