Use short ptr for source location payload data.

This commit is contained in:
Bartosz Taudul 2019-11-02 16:37:27 +01:00
parent 04c92f8d19
commit 0df29d1e0b
2 changed files with 3 additions and 3 deletions

View File

@ -2303,7 +2303,7 @@ std::vector<int16_t> Worker::GetMatchingSourceLocation( const char* query, bool
} }
if( found ) if( found )
{ {
auto it = m_data.sourceLocationPayloadMap.find( srcloc ); auto it = m_data.sourceLocationPayloadMap.find( (const SourceLocation*)srcloc );
assert( it != m_data.sourceLocationPayloadMap.end() ); assert( it != m_data.sourceLocationPayloadMap.end() );
match.push_back( -int16_t( it->second + 1 ) ); match.push_back( -int16_t( it->second + 1 ) );
} }

View File

@ -178,8 +178,8 @@ private:
flat_hash_map<uint64_t, std::pair<const char*, const char*>, nohash<uint64_t>> externalNames; flat_hash_map<uint64_t, std::pair<const char*, const char*>, nohash<uint64_t>> externalNames;
flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation; flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation;
Vector<SourceLocation*> sourceLocationPayload; Vector<short_ptr<SourceLocation>> sourceLocationPayload;
flat_hash_map<SourceLocation*, int16_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap; flat_hash_map<const SourceLocation*, int16_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap;
Vector<uint64_t> sourceLocationExpand; Vector<uint64_t> sourceLocationExpand;
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
flat_hash_map<int16_t, SourceLocationZones, nohash<int16_t>> sourceLocationZones; flat_hash_map<int16_t, SourceLocationZones, nohash<int16_t>> sourceLocationZones;