mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add cache for last accessed source location zones.
This commit is contained in:
@@ -216,6 +216,9 @@ private:
|
||||
std::pair<uint64_t, ContextSwitch*> ctxSwitchLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr );
|
||||
uint64_t checkSrclocLast = 0;
|
||||
std::pair<uint64_t, uint16_t> shrinkSrclocLast = std::make_pair( std::numeric_limits<uint64_t>::max(), 0 );
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
std::pair<uint16_t, SourceLocationZones*> srclocZonesLast = std::make_pair( std::numeric_limits<uint16_t>::max(), nullptr );
|
||||
#endif
|
||||
};
|
||||
|
||||
struct MbpsBlock
|
||||
@@ -498,6 +501,15 @@ private:
|
||||
return RetrieveThreadReal( thread );
|
||||
}
|
||||
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
SourceLocationZones* GetSourceLocationZones( uint16_t srcloc )
|
||||
{
|
||||
if( m_data.srclocZonesLast.first == srcloc ) return m_data.srclocZonesLast.second;
|
||||
return GetSourceLocationZonesReal( srcloc );
|
||||
}
|
||||
SourceLocationZones* GetSourceLocationZonesReal( uint16_t srcloc );
|
||||
#endif
|
||||
|
||||
tracy_force_inline void NewZone( ZoneEvent* zone, uint64_t thread );
|
||||
|
||||
void InsertLockEvent( LockMap& lockmap, LockEvent* lev, uint64_t thread, int64_t time );
|
||||
|
||||
Reference in New Issue
Block a user