From c5133e0b4ee3315baec2f444eab0a5b781a828f8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Apr 2018 03:21:40 +0200 Subject: [PATCH] Walk lockmap timeline pointer. --- server/TracyWorker.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 1197c192..30146a16 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -325,7 +325,8 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) lockmap.threadList.emplace_back( t ); } f.Read( &tsz, sizeof( tsz ) ); - lockmap.timeline.reserve( tsz ); + lockmap.timeline.reserve_and_use( tsz ); + auto ptr = lockmap.timeline.data(); if( fileVer >= FileVersion( 0, 3, 0 ) ) { if( lockmap.type == LockType::Lockable ) @@ -337,7 +338,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Read( &lev->srcloc, sizeof( lev->srcloc ) ); f.Read( &lev->thread, sizeof( lev->thread ) ); f.Read( &lev->type, sizeof( lev->type ) ); - lockmap.timeline.push_back_no_space_check( lev ); + *ptr++ = lev; } } else @@ -349,7 +350,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Read( &lev->srcloc, sizeof( lev->srcloc ) ); f.Read( &lev->thread, sizeof( lev->thread ) ); f.Read( &lev->type, sizeof( lev->type ) ); - lockmap.timeline.push_back_no_space_check( lev ); + *ptr++ = lev; } } } @@ -366,7 +367,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Skip( sizeof( uint8_t ) ); f.Read( &lev->type, sizeof( lev->type ) ); f.Skip( sizeof( uint8_t ) + sizeof( uint64_t ) ); - lockmap.timeline.push_back_no_space_check( lev ); + *ptr++ = lev; } } else @@ -380,7 +381,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Skip( sizeof( uint8_t ) ); f.Read( &lev->type, sizeof( lev->type ) ); f.Skip( sizeof( uint8_t ) + sizeof( uint64_t ) * 3 ); - lockmap.timeline.push_back_no_space_check( lev ); + *ptr++ = lev; } } }