1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Make srcloc dynamic color depend on function name.

This commit is contained in:
Bartosz Taudul
2019-11-01 20:17:25 +01:00
parent ca0fae33d1
commit 13b656fe61
3 changed files with 29 additions and 7 deletions
+8 -3
View File
@@ -135,7 +135,7 @@ private:
};
struct SourceLocation
struct SourceLocationBase
{
StringRef name;
StringRef function;
@@ -144,6 +144,11 @@ struct SourceLocation
uint32_t color;
};
struct SourceLocation : public SourceLocationBase
{
mutable uint32_t namehash;
};
enum { SourceLocationSize = sizeof( SourceLocation ) };
@@ -510,7 +515,7 @@ struct SourceLocationHasher
{
size_t operator()( const SourceLocation* ptr ) const
{
return charutil::hash( (const char*)ptr, sizeof( SourceLocation ) );
return charutil::hash( (const char*)ptr, sizeof( SourceLocationBase ) );
}
typedef tracy::power_of_two_hash_policy hash_policy;
};
@@ -519,7 +524,7 @@ struct SourceLocationComparator
{
bool operator()( const SourceLocation* lhs, const SourceLocation* rhs ) const
{
return memcmp( lhs, rhs, sizeof( SourceLocation ) ) == 0;
return memcmp( lhs, rhs, sizeof( SourceLocationBase ) ) == 0;
}
};