1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 12:53:51 +00:00

Walk plot data pointer.

This commit is contained in:
Bartosz Taudul 2018-04-29 02:11:47 +02:00
parent 868fbace5a
commit aceaed25b9

View File

@ -568,9 +568,9 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
double min = 0; double min = 0;
double max = std::numeric_limits<double>::min(); double max = std::numeric_limits<double>::min();
uint64_t usage = 0; uint64_t usage = 0;
size_t idx = 1;
plot->data[0] = { GetFrameBegin( 0 ), 0. }; auto ptr = plot->data.data();
*ptr++ = { GetFrameBegin( 0 ), 0. };
while( aptr != aend && fptr != fend ) while( aptr != aend && fptr != fend )
{ {
@ -589,7 +589,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
} }
assert( min <= usage ); assert( min <= usage );
if( max < usage ) max = usage; if( max < usage ) max = usage;
plot->data[idx++] = { time, double( usage ) }; *ptr++ = { time, double( usage ) };
} }
while( aptr != aend ) while( aptr != aend )
{ {
@ -598,7 +598,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
usage += aptr->size; usage += aptr->size;
assert( min <= usage ); assert( min <= usage );
if( max < usage ) max = usage; if( max < usage ) max = usage;
plot->data[idx++] = { time, double( usage ) }; *ptr++ = { time, double( usage ) };
aptr++; aptr++;
} }
while( fptr != fend ) while( fptr != fend )
@ -607,12 +607,10 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
usage -= fptr->second; usage -= fptr->second;
assert( min <= usage ); assert( min <= usage );
assert( max >= usage ); assert( max >= usage );
plot->data[idx++] = { time, double( usage ) }; *ptr++ = { time, double( usage ) };
fptr++; fptr++;
} }
assert( idx == psz );
plot->min = min; plot->min = min;
plot->max = max; plot->max = max;
} }