diff --git a/test/test.cpp b/test/test.cpp index 1d972511..325620fb 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -33,6 +33,19 @@ void operator delete( void* ptr ) noexcept free( ptr ); } +void* CustomAlloc( size_t count ) +{ + auto ptr = malloc( count ); + TracyAllocNS( ptr, count, 10, "Custom alloc" ); + return ptr; +} + +void CustomFree( void* ptr ) +{ + TracyFreeNS( ptr, 10, "Custom alloc" ); + free( ptr ); +} + void TestFunction() { tracy::SetThreadName( "First/second thread" ); @@ -254,6 +267,16 @@ void OnlyMemory() { tracy::SetThreadName( "Only memory" ); new int; + + void* ptrs[16]; + for( int i=1; i<16; i++ ) + { + ptrs[i] = CustomAlloc( i * 1024 ); + } + for( int i=1; i<16; i++ ) + { + CustomFree( ptrs[i] ); + } } static TracyLockable( std::mutex, deadlockMutex1 );