Browse Source

gdscript: Only include profiling variables when DEBUG is enabled

Alistair Leslie-Hughes 1 year ago
parent
commit
f489c313cc
2 changed files with 5 additions and 0 deletions
  1. 3 0
      modules/gdscript/gdscript.cpp
  2. 2 0
      modules/gdscript/gdscript.h

+ 3 - 0
modules/gdscript/gdscript.cpp

@@ -2857,8 +2857,11 @@ GDScriptLanguage::GDScriptLanguage() {
 	_debug_parse_err_line = -1;
 	_debug_parse_err_line = -1;
 	_debug_parse_err_file = "";
 	_debug_parse_err_file = "";
 
 
+#ifdef DEBUG_ENABLED
 	profiling = false;
 	profiling = false;
+	profile_native_calls = false;
 	script_frame_time = 0;
 	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);
 	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);
 
 

+ 2 - 0
modules/gdscript/gdscript.h

@@ -459,9 +459,11 @@ class GDScriptLanguage : public ScriptLanguage {
 	friend class GDScriptFunction;
 	friend class GDScriptFunction;
 
 
 	SelfList<GDScriptFunction>::List function_list;
 	SelfList<GDScriptFunction>::List function_list;
+#ifdef DEBUG_ENABLED
 	bool profiling;
 	bool profiling;
 	bool profile_native_calls;
 	bool profile_native_calls;
 	uint64_t script_frame_time;
 	uint64_t script_frame_time;
+#endif
 
 
 	HashMap<String, ObjectID> orphan_subclasses;
 	HashMap<String, ObjectID> orphan_subclasses;