diff --git a/server/TracyCharUtil.hpp b/server/TracyCharUtil.hpp index 8dd777fd..8b09f3bf 100644 --- a/server/TracyCharUtil.hpp +++ b/server/TracyCharUtil.hpp @@ -69,6 +69,33 @@ struct LessComparator } }; +struct StringKey +{ + const char* ptr; + size_t sz; + + struct Hasher + { + size_t operator()( const StringKey& key ) const + { + return hash( key.ptr, key.sz ); + } + }; + + struct HasherPOT : public Hasher + { + typedef tracy::power_of_two_hash_policy hash_policy; + }; + + struct Comparator + { + bool operator()( const StringKey& lhs, const StringKey& rhs ) const + { + return lhs.sz == rhs.sz && memcmp( lhs.ptr, rhs.ptr, lhs.sz ) == 0; + } + }; +}; + } }