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

Use flat_hash_map for source location payload map.

This commit is contained in:
Bartosz Taudul 2017-11-24 01:10:12 +01:00
parent 7a13892754
commit f2a19c4593
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#include <string.h> #include <string.h>
#include "TracyVector.hpp" #include "TracyVector.hpp"
#include "tracy_flat_hash_map.hpp"
namespace tracy namespace tracy
{ {
@ -210,6 +211,7 @@ struct SourceLocationHasher
{ {
return charutil::hash( (const char*)ptr, sizeof( SourceLocation ) ); return charutil::hash( (const char*)ptr, sizeof( SourceLocation ) );
} }
typedef tracy::power_of_two_hash_policy hash_policy;
}; };
struct SourceLocationComparator struct SourceLocationComparator

View File

@ -189,7 +189,7 @@ private:
std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> m_stringMap; std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> m_stringMap;
Vector<SourceLocation*> m_sourceLocationPayload; Vector<SourceLocation*> m_sourceLocationPayload;
std::unordered_map<SourceLocation*, uint32_t, SourceLocationHasher, SourceLocationComparator> m_sourceLocationPayloadMap; flat_hash_map<SourceLocation*, uint32_t, SourceLocationHasher, SourceLocationComparator> m_sourceLocationPayloadMap;
NonRecursiveBenaphore m_mbpslock; NonRecursiveBenaphore m_mbpslock;
std::vector<float> m_mbps; std::vector<float> m_mbps;