From 16558f2915f57edd2972e8f5132dbf4203b7941c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gr=C3=A9goire?= Date: Tue, 16 Dec 2025 19:49:08 +0100 Subject: [PATCH] Fix unknown allocation message in debug due to alloc name litteral not pointing to the same location --- test/test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test.cpp b/test/test.cpp index 4afdd02b..e2ff591b 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -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 ); }