From 408088d1a57a7eca1267b9d69265d756fff0c90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 31 May 2023 11:03:12 +0200 Subject: [PATCH 1/2] Disable debug asserts and logging in Windows release builds We allowed debug asserts and logging to be enabled in Windows on the assumption of CPU power just always being strong enough. But there are slow x86/x64 devices out there, and we shouldn't slow them down unnecessarily. Can always use debug builds to debug stuff. --- Common/Log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Log.h b/Common/Log.h index 7913cb0b08..52a87b26af 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -83,7 +83,7 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, ; bool GenericLogEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type); -#if defined(_DEBUG) || defined(_WIN32) +#if defined(_DEBUG) #define MAX_LOGLEVEL DEBUG_LEVEL From 9d9c2c750e57e625d47c373396c98913ab7ddfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 1 Jun 2023 23:52:52 +0200 Subject: [PATCH 2/2] SWitch dbg asserts to new policy - debug mode controls it, even on Windows. --- Common/Log.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/Log.h b/Common/Log.h index 52a87b26af..beb7142f72 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -83,7 +83,8 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, ; bool GenericLogEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type); -#if defined(_DEBUG) +// Exception for Windows - enable more log levels in release mode than on other platforms. +#if defined(_DEBUG) || defined(_WIN32) #define MAX_LOGLEVEL DEBUG_LEVEL @@ -128,8 +129,8 @@ void SetExtraAssertInfo(const char *info); #define __FILENAME__ __FILE__ #endif -// If we're in "debug" assert mode -#if MAX_LOGLEVEL >= DEBUG_LEVEL +// If we're a debug build, _dbg_assert_ is active. Not otherwise, even on Windows. +#if defined(_DEBUG) #define _dbg_assert_(_a_) \ if (!(_a_)) {\