mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
StringIdx search from string.
This commit is contained in:
parent
387fdb30b0
commit
e7f4f58886
@ -2379,6 +2379,20 @@ int64_t Worker::GetZoneEnd( const GpuEvent& ev )
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t Worker::FindStringIdx( const char* str ) const
|
||||
{
|
||||
charutil::StringKey key = { str, strlen( str ) };
|
||||
auto sit = m_data.stringMap.find( key );
|
||||
if( sit == m_data.stringMap.end() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return sit->second;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Worker::GetString( uint64_t ptr ) const
|
||||
{
|
||||
const auto it = m_data.strings.find( ptr );
|
||||
|
@ -455,6 +455,7 @@ public:
|
||||
static tracy_force_inline int64_t GetZoneEndDirect( const ZoneEvent& ev ) { return ev.IsEndValid() ? ev.End() : ev.Start(); }
|
||||
static tracy_force_inline int64_t GetZoneEndDirect( const GpuEvent& ev ) { return ev.GpuEnd() >= 0 ? ev.GpuEnd() : ev.GpuStart(); }
|
||||
|
||||
uint32_t FindStringIdx( const char* str ) const;
|
||||
const char* GetString( uint64_t ptr ) const;
|
||||
const char* GetString( const StringRef& ref ) const;
|
||||
const char* GetString( const StringIdx& idx ) const;
|
||||
|
Loading…
Reference in New Issue
Block a user