Skip to content

Commit 5833f0d

Browse files
committed
Add SourceContents::Parse() with length argument.
1 parent d4094f4 commit 5833f0d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎profiler/src/profiler/TracySourceContents.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ void SourceContents::Parse( const char* fileName, const Worker& worker, const Vi
6969
void SourceContents::Parse( const char* source )
7070
{
7171
if( source == m_data ) return;
72+
Parse( m_data, strlen( source ) );
73+
}
7274

73-
const size_t len = strlen( source );
74-
75+
void SourceContents::Parse( const char* source, size_t len )
76+
{
7577
m_file = nullptr;
7678
m_fileStringIdx = 0;
7779
m_data = source;

‎profiler/src/profiler/TracySourceContents.hpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class SourceContents
2121

2222
void Parse( const char* fileName, const Worker& worker, const View& view );
2323
void Parse( const char* source );
24+
void Parse( const char* source, size_t len );
2425

2526
const std::vector<Tokenizer::Line>& get() const { return m_lines; }
2627
bool empty() const { return m_lines.empty(); }

0 commit comments

Comments
 (0)