mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Prevent storing variable on stack.
This commit is contained in:
parent
1fe76be955
commit
d6a8a8532f
@ -123,9 +123,9 @@ enum { SourceLocationSize = sizeof( SourceLocation ) };
|
||||
struct ZoneEvent
|
||||
{
|
||||
int64_t Start() const { return int64_t( _start_srcloc ) >> 16; }
|
||||
void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_srcloc)+2, &start, 6 ); }
|
||||
void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_srcloc)+2, &start, 4 ); memcpy( ((char*)&_start_srcloc)+6, ((char*)&start)+4, 2 ); }
|
||||
int64_t End() const { return int64_t( _end_child1 ) >> 16; }
|
||||
void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_end_child1)+2, &end, 6 ); }
|
||||
void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_end_child1)+2, &end, 4 ); memcpy( ((char*)&_end_child1)+6, ((char*)&end)+4, 2 ); }
|
||||
int16_t SrcLoc() const { return int16_t( _start_srcloc & 0xFFFF ); }
|
||||
void SetSrcLoc( int16_t srcloc ) { memcpy( &_start_srcloc, &srcloc, 2 ); }
|
||||
int32_t Child() const { return int32_t( uint32_t( _end_child1 & 0xFFFF ) | ( uint32_t( _child2 ) << 16 ) ); }
|
||||
@ -156,7 +156,7 @@ struct LockEvent
|
||||
};
|
||||
|
||||
int64_t Time() const { return int64_t( _time_srcloc ) >> 16; }
|
||||
void SetTime( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_srcloc)+2, &time, 6 ); }
|
||||
void SetTime( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_srcloc)+2, &time, 4 ); memcpy( ((char*)&_time_srcloc)+6, ((char*)&time)+4, 2 ); }
|
||||
int16_t SrcLoc() const { return int16_t( _time_srcloc & 0xFFFF ); }
|
||||
void SetSrcLoc( int16_t srcloc ) { memcpy( &_time_srcloc, &srcloc, 2 ); }
|
||||
|
||||
@ -190,9 +190,9 @@ static_assert( std::numeric_limits<decltype(LockEventPtr::lockCount)>::max() >=
|
||||
struct GpuEvent
|
||||
{
|
||||
int64_t CpuStart() const { return int64_t( _cpuStart_srcloc ) >> 16; }
|
||||
void SetCpuStart( int64_t cpuStart ) { assert( cpuStart < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_cpuStart_srcloc)+2, &cpuStart, 6 ); }
|
||||
void SetCpuStart( int64_t cpuStart ) { assert( cpuStart < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_cpuStart_srcloc)+2, &cpuStart, 4 ); memcpy( ((char*)&_cpuStart_srcloc)+6, ((char*)&cpuStart)+4, 2 ); }
|
||||
int64_t CpuEnd() const { return int64_t( _cpuEnd_thread ) >> 16; }
|
||||
void SetCpuEnd( int64_t cpuEnd ) { assert( cpuEnd < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_cpuEnd_thread)+2, &cpuEnd, 6 ); }
|
||||
void SetCpuEnd( int64_t cpuEnd ) { assert( cpuEnd < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_cpuEnd_thread)+2, &cpuEnd, 4 ); memcpy( ((char*)&_cpuEnd_thread)+6, ((char*)&cpuEnd)+4, 2 ); }
|
||||
int16_t SrcLoc() const { return int16_t( _cpuStart_srcloc & 0xFFFF ); }
|
||||
void SetSrcLoc( int16_t srcloc ) { memcpy( &_cpuStart_srcloc, &srcloc, 2 ); }
|
||||
uint16_t Thread() const { return uint16_t( _cpuEnd_thread & 0xFFFF ); }
|
||||
@ -213,9 +213,9 @@ static_assert( std::is_standard_layout<GpuEvent>::value, "GpuEvent is not standa
|
||||
struct MemEvent
|
||||
{
|
||||
int64_t TimeAlloc() const { return int64_t( _time_thread_alloc ) >> 16; }
|
||||
void SetTimeAlloc( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_thread_alloc)+2, &time, 6 ); }
|
||||
void SetTimeAlloc( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_thread_alloc)+2, &time, 4 ); memcpy( ((char*)&_time_thread_alloc)+6, ((char*)&time)+4, 2 ); }
|
||||
int64_t TimeFree() const { return int64_t( _time_thread_free ) >> 16; }
|
||||
void SetTimeFree( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_thread_free)+2, &time, 6 ); }
|
||||
void SetTimeFree( int64_t time ) { assert( time < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_time_thread_free)+2, &time, 4 ); memcpy( ((char*)&_time_thread_free)+6, ((char*)&time)+4, 2 ); }
|
||||
uint16_t ThreadAlloc() const { return uint16_t( _time_thread_alloc ); }
|
||||
void SetThreadAlloc( uint16_t thread ) { memcpy( &_time_thread_alloc, &thread, 2 ); }
|
||||
uint16_t ThreadFree() const { return uint16_t( _time_thread_free ); }
|
||||
@ -295,9 +295,9 @@ struct ContextSwitchData
|
||||
enum : int8_t { Wakeup = -2 };
|
||||
|
||||
int64_t Start() const { return int64_t( _start_cpu ) >> 16; }
|
||||
void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_cpu)+2, &start, 6 ); }
|
||||
void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_cpu)+2, &start, 4 ); memcpy( ((char*)&_start_cpu)+6, ((char*)&start)+4, 2 ); }
|
||||
int64_t End() const { return int64_t( _end_reason_state ) >> 16; }
|
||||
void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_end_reason_state)+2, &end, 6 ); }
|
||||
void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_end_reason_state)+2, &end, 4 ); memcpy( ((char*)&_end_reason_state)+6, ((char*)&end)+4, 2 ); }
|
||||
uint8_t Cpu() const { return uint8_t( _start_cpu & 0xFF ); }
|
||||
void SetCpu( uint8_t cpu ) { memcpy( &_start_cpu, &cpu, 1 ); }
|
||||
int8_t Reason() const { return int8_t( (_end_reason_state >> 8) & 0xFF ); }
|
||||
@ -316,7 +316,7 @@ enum { ContextSwitchDataSize = sizeof( ContextSwitchData ) };
|
||||
struct ContextSwitchCpu
|
||||
{
|
||||
int64_t Start() const { return int64_t( _start_thread ) >> 16; }
|
||||
void SetStart( int64_t start ) { assert( start < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_start_thread)+2, &start, 6 ); }
|
||||
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 ); }
|
||||
int64_t End() const { return _end; }
|
||||
void SetEnd( int64_t end ) { assert( end < (int64_t)( 1ull << 47 ) ); _end = end; }
|
||||
uint16_t Thread() const { return uint16_t( _start_thread ); }
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
struct ZoneThreadData
|
||||
{
|
||||
ZoneEvent* Zone() const { return (ZoneEvent*)( _zone_thread >> 16 ); }
|
||||
void SetZone( ZoneEvent* zone ) { assert( ( uint64_t( zone ) & 0xFFFF000000000000 ) == 0 ); memcpy( ((char*)&_zone_thread)+2, &zone, 6 ); }
|
||||
void SetZone( ZoneEvent* zone ) { assert( ( uint64_t( zone ) & 0xFFFF000000000000 ) == 0 ); memcpy( ((char*)&_zone_thread)+2, &zone, 4 ); memcpy( ((char*)&_zone_thread)+6, ((char*)&zone)+4, 2 ); }
|
||||
uint16_t Thread() const { return uint16_t( _zone_thread & 0xFFFF ); }
|
||||
void SetThread( uint16_t thread ) { memcpy( &_zone_thread, &thread, 2 ); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user