update tracy from 11.0 to 13.1 and fix build with tracy enabled

This commit is contained in:
Sven Balzer
2026-05-01 18:24:04 +02:00
parent 7fa5294e02
commit 2adf75973a
304 changed files with 20579 additions and 170182 deletions
+2 -8
View File
@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.16)
option(USE_DEBUGINFOD "Compile with debuginfod integration" ON)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
# we target C++11 for the client part
@@ -25,15 +23,11 @@ target_link_libraries(tracy-test TracyClient)
# OS-specific options
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND USE_DEBUGINFOD)
target_compile_definitions(tracy-test PRIVATE TRACY_DEBUGINFOD)
target_link_libraries(tracy-test "debuginfod")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
target_link_libraries(tracy-test "execinfo")
endif()
# copy image file in build folder
configure_file(${CMAKE_CURRENT_LIST_DIR}/image.jpg image.jpg COPYONLY)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT tracy-test)
+24 -4
View File
@@ -315,12 +315,31 @@ void DeadlockTest2()
deadlockMutex1.lock();
}
void ArenaAllocatorTest()
{
tracy::SetThreadName( "Arena allocator test" );
auto arena = (char*)0x12345678;
auto aptr = arena;
for( int i=0; i<10; i++ )
{
for( int j=0; j<10; j++ )
{
const auto allocSize = 1024 + j * 128 - i * 64;
TracyAllocN( aptr, allocSize, "Arena alloc" );
aptr += allocSize;
std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
}
TracyMemoryDiscard( "Arena alloc" );
aptr = arena;
std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
}
}
int main()
{
#ifdef _WIN32
signal( SIGUSR1, SignalHandler_TriggerCrash );
signal( SIGUSR2, SignalHandler_TriggerInstrumentationFailure );
#else
#ifndef _WIN32
struct sigaction sigusr1, oldsigusr1,sigusr2, oldsigusr2 ;
memset( &sigusr1, 0, sizeof( sigusr1 ) );
sigusr1.sa_handler = SignalHandler_TriggerCrash;
@@ -355,6 +374,7 @@ int main()
auto t20 = std::thread( OnlyMemory );
auto t21 = std::thread( DeadlockTest1 );
auto t22 = std::thread( DeadlockTest2 );
auto t23 = std::thread( ArenaAllocatorTest );
int x, y;
auto image = stbi_load( "image.jpg", &x, &y, nullptr, 4 );