1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Move common event data to separate struct.

This commit is contained in:
Bartosz Taudul 2017-09-12 00:56:31 +02:00
parent aa10adcc9c
commit 25d7cebd8a
2 changed files with 12 additions and 3 deletions

View File

@ -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 ) );
}

View File

@ -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;