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

Separate custom string processing from string storage.

This commit is contained in:
Bartosz Taudul
2017-11-10 17:45:19 +01:00
parent f6af913fd3
commit 2887753b5d
2 changed files with 36 additions and 17 deletions
+11 -3
View File
@@ -115,6 +115,12 @@ private:
uint64_t postponeTime;
};
struct StringLocation
{
const char* ptr;
uint32_t idx;
};
void Worker();
void DispatchProcess( const QueueItem& ev, const char*& ptr );
@@ -144,11 +150,13 @@ private:
void AddString( uint64_t ptr, std::string&& str );
void AddThreadString( uint64_t id, std::string&& str );
void AddCustomString( uint64_t ptr, std::string&& str );
void AddCustomString( uint64_t ptr, const std::string& str );
void AddSourceLocation( const QueueSourceLocation& srcloc );
void AddSourceLocationPayload( uint64_t ptr, const char* data, size_t sz );
void AddMessageData( uint64_t ptr, const char* str, size_t sz );
StringLocation StoreString( const std::string& str );
uint32_t ShrinkSourceLocation( uint64_t srcloc );
void InsertMessageData( MessageData* msg, uint64_t thread );
@@ -237,8 +245,8 @@ private:
std::map<uint32_t, LockMap> m_lockMap;
uint64_t m_zonesCnt;
Vector<const char*> m_customStringData;
std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> m_customStringMap;
Vector<const char*> m_stringData;
std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> m_stringMap;
std::mutex m_mbpslock;
std::vector<float> m_mbps;