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

Add LocationToString() helper.

This commit is contained in:
Bartosz Taudul
2021-06-19 12:33:23 +02:00
parent c69cf5bd3f
commit 91f1845d92
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -411,6 +411,20 @@ const char* MemSizeToString( int64_t val )
return buf;
}
const char* LocationToString( const char* fn, uint32_t line )
{
if( line == 0 ) return fn;
enum { Pool = 8 };
static char bufpool[Pool][4096];
static int bufsel = 0;
char* buf = bufpool[bufsel];
bufsel = ( bufsel + 1 ) % Pool;
sprintf( buf, "%s:%i", fn, line );
return buf;
}
namespace detail
{