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

Prevent source location payload duplication.

This commit is contained in:
Bartosz Taudul
2017-11-11 02:31:51 +01:00
parent 24084cbcd2
commit ca4483ecf5
4 changed files with 53 additions and 12 deletions
+15
View File
@@ -23,6 +23,21 @@ static inline uint32_t hash( const char* str )
return hash;
}
static inline uint32_t hash( const char* str, size_t sz )
{
uint32_t hash = 5381;
int c;
while( sz > 0 )
{
c = *str++;
hash = ( ( hash << 5 ) + hash ) ^ c;
sz--;
}
return hash;
}
struct Hasher
{
size_t operator()( const char* key ) const