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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user