mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Reserve memory for loaded data.
This commit is contained in:
parent
a96f58c3de
commit
8f862b3271
@ -85,6 +85,7 @@ View::View( FileRead& f )
|
|||||||
|
|
||||||
uint64_t sz;
|
uint64_t sz;
|
||||||
f.Read( &sz, sizeof( sz ) );
|
f.Read( &sz, sizeof( sz ) );
|
||||||
|
m_frames.reserve( sz );
|
||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
uint64_t v;
|
uint64_t v;
|
||||||
@ -143,6 +144,7 @@ View::View( FileRead& f )
|
|||||||
}
|
}
|
||||||
|
|
||||||
f.Read( &sz, sizeof( sz ) );
|
f.Read( &sz, sizeof( sz ) );
|
||||||
|
m_threads.reserve( sz );
|
||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
auto td = new ThreadData;
|
auto td = new ThreadData;
|
||||||
@ -1658,6 +1660,7 @@ void View::ReadTimeline( FileRead& f, Vector<Event*>& vec, Event* parent, const
|
|||||||
{
|
{
|
||||||
uint64_t sz;
|
uint64_t sz;
|
||||||
f.Read( &sz, sizeof( sz ) );
|
f.Read( &sz, sizeof( sz ) );
|
||||||
|
vec.reserve( sz );
|
||||||
|
|
||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user