1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Change TRACY_DISABLE to TRACY_ENABLE.

By default tracy is now disabled.
This commit is contained in:
Bartosz Taudul 2017-10-16 21:34:39 +02:00
parent 518568a513
commit 8a6e4d2971
4 changed files with 16 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#ifndef __TRACY_HPP__ #ifndef __TRACY_HPP__
#define __TRACY_HPP__ #define __TRACY_HPP__
#ifdef TRACY_DISABLE #ifndef TRACY_ENABLE
#define ZoneScoped #define ZoneScoped
#define ZoneScopedC(x) #define ZoneScopedC(x)

View File

@ -7,6 +7,10 @@
// other). // other).
// //
// Define TRACY_ENABLE to enable profiler.
#ifdef TRACY_ENABLE
#include "client/TracyProfiler.cpp" #include "client/TracyProfiler.cpp"
#include "common/tracy_lz4.cpp" #include "common/tracy_lz4.cpp"
#include "common/TracySocket.cpp" #include "common/TracySocket.cpp"
@ -16,3 +20,5 @@
#ifdef _MSC_VER #ifdef _MSC_VER
# pragma comment(lib, "ws2_32.lib") # pragma comment(lib, "ws2_32.lib")
#endif #endif
#endif

View File

@ -1,3 +1,5 @@
#ifdef TRACY_ENABLE
#ifdef _MSC_VER #ifdef _MSC_VER
# include <winsock2.h> # include <winsock2.h>
# include <windows.h> # include <windows.h>
@ -73,9 +75,7 @@ static moodycamel::ConcurrentQueue<QueueItem> init_order(103) s_queue( QueuePrea
static thread_local moodycamel::ProducerToken init_order(104) s_token_detail( s_queue ); static thread_local moodycamel::ProducerToken init_order(104) s_token_detail( s_queue );
thread_local ProducerWrapper init_order(105) s_token { s_queue.get_explicit_producer( s_token_detail ) }; thread_local ProducerWrapper init_order(105) s_token { s_queue.get_explicit_producer( s_token_detail ) };
#ifndef TRACY_DISABLE
static Profiler init_order(106) s_profiler; static Profiler init_order(106) s_profiler;
#endif
static Profiler* s_instance = nullptr; static Profiler* s_instance = nullptr;
static Thread* s_thread = nullptr; static Thread* s_thread = nullptr;
@ -424,3 +424,5 @@ void Profiler::CalibrateDelay()
} }
} }
#endif

View File

@ -1,3 +1,5 @@
#ifdef TRACY_ENABLE
/* rpmalloc.c - Memory allocator - Public Domain - 2016 Mattias Jansson / Rampant Pixels /* rpmalloc.c - Memory allocator - Public Domain - 2016 Mattias Jansson / Rampant Pixels
* *
* This library provides a cross-platform lock free thread caching malloc implementation in C11. * This library provides a cross-platform lock free thread caching malloc implementation in C11.
@ -1782,4 +1784,6 @@ rpmalloc_global_statistics(rpmalloc_global_statistics_t* stats) {
} }
} }
} }
#endif