From caace1ce11cdb843bf7010580286bb3b8d97cde1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 11 Feb 2020 02:24:40 +0100 Subject: [PATCH] Directly access memory, omitting shift. As always, clang generated the right code here anyways... --- server/TracyEvent.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 9672ca61..048a83c3 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -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 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 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 ); } uint64_t _time_other_own;