From 36ecf16d59810bb5c207a379e90c035058d2ebd8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 19 Sep 2017 02:19:27 +0200 Subject: [PATCH] Add comments to the constant merging assert. --- client/TracyProfiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 46fa1a3f..d9839dd2 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -47,7 +47,13 @@ Profiler::Profiler() , m_buffer( new char[TargetFrameSize*3] ) , m_bufferOffset( 0 ) { + // This check verifies that the string literals from different compilation units are placed at the + // same address by the linker. + // MSVC: make sure "Enable String Pooling" is active (/GF). + // gcc: make sure -fmerge-constants is enabled (it is automatically enabled only in optimized builds). + // clang: seems to be enabled by default. assert( PointerCheckA == PointerCheckB ); + assert( !s_instance ); s_instance = this;