mirror of
https://github.com/wolfpld/tracy
synced 2025-04-28 20:23:51 +00:00
Move common event data to separate struct.
This commit is contained in:
parent
aa10adcc9c
commit
25d7cebd8a
@ -49,14 +49,18 @@ uint64_t Profiler::GetNewId()
|
||||
|
||||
void Profiler::ZoneBegin( QueueZoneBegin&& data )
|
||||
{
|
||||
QueueItem item { QueueType::ZoneBegin, GetTime() };
|
||||
QueueItem item;
|
||||
item.hdr.type = QueueType::ZoneBegin;
|
||||
item.hdr.time = GetTime();
|
||||
item.zoneBegin = std::move( data );
|
||||
s_instance->m_queue.enqueue( GetToken(), std::move( item ) );
|
||||
}
|
||||
|
||||
void Profiler::ZoneEnd( QueueZoneEnd&& data )
|
||||
{
|
||||
QueueItem item { QueueType::ZoneEnd, GetTime() };
|
||||
QueueItem item;
|
||||
item.hdr.type = QueueType::ZoneEnd;
|
||||
item.hdr.time = GetTime();
|
||||
item.zoneEnd = std::move( data );
|
||||
s_instance->m_queue.enqueue( GetToken(), std::move( item ) );
|
||||
}
|
||||
|
@ -27,10 +27,15 @@ struct QueueZoneEnd
|
||||
uint64_t id;
|
||||
};
|
||||
|
||||
struct QueueItem
|
||||
struct QueueHeader
|
||||
{
|
||||
QueueType type;
|
||||
int64_t time;
|
||||
};
|
||||
|
||||
struct QueueItem
|
||||
{
|
||||
QueueHeader hdr;
|
||||
union
|
||||
{
|
||||
QueueZoneBegin zoneBegin;
|
||||
|
Loading…
x
Reference in New Issue
Block a user