Move structs out of TracyView.

This commit is contained in:
Bartosz Taudul 2017-11-11 19:21:07 +01:00
parent 8868cad7b1
commit ce35009c63
3 changed files with 76 additions and 75 deletions

View File

@ -96,6 +96,80 @@ static_assert( std::numeric_limits<decltype(LockEvent::lockCount)>::max() >= Max
#pragma pack()
struct MessageData
{
int64_t time;
StringRef ref;
};
struct ThreadData
{
uint64_t id;
bool showFull;
bool visible;
Vector<ZoneEvent*> timeline;
Vector<MessageData*> messages;
};
struct LockMap
{
uint32_t srcloc;
Vector<LockEvent*> timeline;
std::unordered_map<uint64_t, uint8_t> threadMap;
std::vector<uint64_t> threadList;
bool visible;
};
struct LockHighlight
{
int64_t id;
int64_t begin;
int64_t end;
uint8_t thread;
bool blocked;
};
struct PlotItem
{
int64_t time;
double val;
};
struct PlotData
{
uint64_t name;
double min;
double max;
bool showFull;
bool visible;
Vector<PlotItem*> data;
Vector<PlotItem*> postpone;
uint64_t postponeTime;
};
struct StringLocation
{
const char* ptr;
uint32_t idx;
};
struct SourceLocationHasher
{
size_t operator()( const SourceLocation* ptr ) const
{
return charutil::hash( (const char*)ptr, sizeof( SourceLocation ) );
}
};
struct SourceLocationComparator
{
bool operator()( const SourceLocation* lhs, const SourceLocation* rhs ) const
{
return memcmp( lhs, rhs, sizeof( SourceLocation ) ) == 0;
}
};
}
#endif

View File

@ -902,7 +902,7 @@ void View::AddCustomString( uint64_t ptr, char* str, size_t sz )
m_pendingCustomStrings.emplace( ptr, StoreString( str, sz ) );
}
View::StringLocation View::StoreString( char* str, size_t sz )
StringLocation View::StoreString( char* str, size_t sz )
{
StringLocation ret;
const char backup = str[sz];
@ -1017,7 +1017,7 @@ void View::InsertMessageData( MessageData* msg, uint64_t thread )
}
}
View::ThreadData* View::NoticeThread( uint64_t thread )
ThreadData* View::NoticeThread( uint64_t thread )
{
auto it = m_threadMap.find( thread );
if( it == m_threadMap.end() )

View File

@ -46,79 +46,6 @@ private:
Short
};
struct MessageData
{
int64_t time;
StringRef ref;
};
struct ThreadData
{
uint64_t id;
bool showFull;
bool visible;
Vector<ZoneEvent*> timeline;
Vector<MessageData*> messages;
};
struct LockMap
{
uint32_t srcloc;
Vector<LockEvent*> timeline;
std::unordered_map<uint64_t, uint8_t> threadMap;
std::vector<uint64_t> threadList;
bool visible;
};
struct LockHighlight
{
int64_t id;
int64_t begin;
int64_t end;
uint8_t thread;
bool blocked;
};
struct PlotItem
{
int64_t time;
double val;
};
struct PlotData
{
uint64_t name;
double min;
double max;
bool showFull;
bool visible;
Vector<PlotItem*> data;
Vector<PlotItem*> postpone;
uint64_t postponeTime;
};
struct StringLocation
{
const char* ptr;
uint32_t idx;
};
struct SourceLocationHasher
{
size_t operator()( const SourceLocation* ptr ) const
{
return charutil::hash( (const char*)ptr, sizeof( SourceLocation ) );
}
};
struct SourceLocationComparator
{
bool operator()( const SourceLocation* lhs, const SourceLocation* rhs ) const
{
return memcmp( lhs, rhs, sizeof( SourceLocation ) ) == 0;
}
};
void Worker();
void DispatchProcess( const QueueItem& ev, char*& ptr );