mirror of
https://github.com/wolfpld/tracy
synced 2026-01-19 04:52:09 +00:00
Fix unknown allocation message in debug due to alloc name litteral not pointing to the same location
This commit is contained in:
@@ -49,16 +49,18 @@ void operator delete( void* ptr ) noexcept
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
// We need to have the same pointer for both TracyAllocNS and TracyFreeNS
|
||||
static const char* customAllocStr = "Custom alloc";
|
||||
void* CustomAlloc( size_t count )
|
||||
{
|
||||
auto ptr = malloc( count );
|
||||
TracyAllocNS( ptr, count, 10, "Custom alloc" );
|
||||
TracyAllocNS( ptr, count, 10, customAllocStr );
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void CustomFree( void* ptr )
|
||||
{
|
||||
TracyFreeNS( ptr, 10, "Custom alloc" );
|
||||
TracyFreeNS( ptr, 10, customAllocStr );
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user