mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Allow direct access to data size table index.
This commit is contained in:
parent
89dd244693
commit
10b88754d8
@ -114,7 +114,7 @@ void Profiler::Worker()
|
|||||||
char* ptr = buf;
|
char* ptr = buf;
|
||||||
for( int i=0; i<sz; i++ )
|
for( int i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
const auto dsz = QueueDataSize[(uint8_t)item[i].hdr.type];
|
const auto dsz = QueueDataSize[item[i].hdr.idx];
|
||||||
memcpy( ptr, item+i, dsz );
|
memcpy( ptr, item+i, dsz );
|
||||||
ptr += dsz;
|
ptr += dsz;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,11 @@ struct QueueZoneEnd
|
|||||||
|
|
||||||
struct QueueHeader
|
struct QueueHeader
|
||||||
{
|
{
|
||||||
QueueType type;
|
union
|
||||||
|
{
|
||||||
|
QueueType type;
|
||||||
|
uint8_t idx;
|
||||||
|
};
|
||||||
int64_t time;
|
int64_t time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,14 +82,14 @@ void View::Worker()
|
|||||||
{
|
{
|
||||||
auto ev = (QueueItem*)ptr;
|
auto ev = (QueueItem*)ptr;
|
||||||
Process( *ev );
|
Process( *ev );
|
||||||
ptr += QueueDataSize[(uint8_t)ev->hdr.type];
|
ptr += QueueDataSize[ev->hdr.idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QueueItem hdr;
|
QueueItem hdr;
|
||||||
if( !sock.Read( &hdr.hdr, sizeof( QueueHeader ), &tv, ShouldExit ) ) goto close;
|
if( !sock.Read( &hdr.hdr, sizeof( QueueHeader ), &tv, ShouldExit ) ) goto close;
|
||||||
if( !sock.Read( ((char*)&hdr) + sizeof( QueueHeader ), QueueDataSize[(uint8_t)hdr.hdr.type] - sizeof( QueueHeader ), &tv, ShouldExit ) ) goto close;
|
if( !sock.Read( ((char*)&hdr) + sizeof( QueueHeader ), QueueDataSize[hdr.hdr.idx] - sizeof( QueueHeader ), &tv, ShouldExit ) ) goto close;
|
||||||
Process( hdr );
|
Process( hdr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user