Add very early exit test.

This commit is contained in:
Bartosz Taudul 2021-06-20 14:34:47 +02:00
parent d4b92e0fbe
commit 15b42039bd
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2133,6 +2133,12 @@ void Worker::GetCpuUsage( int64_t t0, double tstep, size_t num, std::vector<std:
{ {
if( out.size() < num ) out.resize( num ); if( out.size() < num ) out.resize( num );
if( t0 > m_data.lastTime || int64_t( t0 + tstep * num ) < 0 )
{
memset( out.data(), 0, sizeof( int ) * 2 * num );
return;
}
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
if( !m_data.ctxUsage.empty() ) if( !m_data.ctxUsage.empty() )
{ {