From f489c313ccc3a0ba06dc210025783d409f6353b2 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 12 Aug 2024 10:02:25 +1000 Subject: [PATCH] gdscript: Only include profiling variables when DEBUG is enabled --- modules/gdscript/gdscript.cpp | 3 +++ modules/gdscript/gdscript.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index eaf2565e6920..7bf5e946fbb6 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2857,8 +2857,11 @@ GDScriptLanguage::GDScriptLanguage() { _debug_parse_err_line = -1; _debug_parse_err_file = ""; +#ifdef DEBUG_ENABLED profiling = false; + profile_native_calls = false; script_frame_time = 0; +#endif int dmcs = GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "512," + itos(GDScriptFunction::MAX_CALL_DEPTH - 1) + ",1"), 1024); diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 4e78fbe30276..6527a0ea4dca 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -459,9 +459,11 @@ class GDScriptLanguage : public ScriptLanguage { friend class GDScriptFunction; SelfList::List function_list; +#ifdef DEBUG_ENABLED bool profiling; bool profile_native_calls; uint64_t script_frame_time; +#endif HashMap orphan_subclasses;