Force inline string copy functions.

This commit is contained in:
Bartosz Taudul 2022-07-20 01:04:59 +02:00
parent 5e0eb7e26b
commit a04f830962
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5,11 +5,12 @@
#include <string.h>
#include "../common/TracyAlloc.hpp"
#include "../common/TracyForceInline.hpp"
namespace tracy
{
static inline char* CopyString( const char* src, size_t sz )
static tracy_force_inline char* CopyString( const char* src, size_t sz )
{
auto dst = (char*)tracy_malloc( sz + 1 );
memcpy( dst, src, sz );
@ -17,7 +18,7 @@ static inline char* CopyString( const char* src, size_t sz )
return dst;
}
static inline char* CopyString( const char* src )
static tracy_force_inline char* CopyString( const char* src )
{
const auto sz = strlen( src );
auto dst = (char*)tracy_malloc( sz + 1 );
@ -26,7 +27,7 @@ static inline char* CopyString( const char* src )
return dst;
}
static inline char* CopyStringFast( const char* src, size_t sz )
static tracy_force_inline char* CopyStringFast( const char* src, size_t sz )
{
auto dst = (char*)tracy_malloc_fast( sz + 1 );
memcpy( dst, src, sz );
@ -34,7 +35,7 @@ static inline char* CopyStringFast( const char* src, size_t sz )
return dst;
}
static inline char* CopyStringFast( const char* src )
static tracy_force_inline char* CopyStringFast( const char* src )
{
const auto sz = strlen( src );
auto dst = (char*)tracy_malloc_fast( sz + 1 );