Inline static variables (part 1)

This commit is contained in:
kobewi 2025-04-28 20:27:50 +02:00
parent 67c96c89cc
commit 5af4bef46f
52 changed files with 85 additions and 247 deletions

View file

@ -36,13 +36,6 @@
#include "core/debugger/script_debugger.h"
#include "core/os/os.h"
EngineDebugger *EngineDebugger::singleton = nullptr;
ScriptDebugger *EngineDebugger::script_debugger = nullptr;
HashMap<StringName, EngineDebugger::Profiler> EngineDebugger::profilers;
HashMap<StringName, EngineDebugger::Capture> EngineDebugger::captures;
HashMap<String, EngineDebugger::CreatePeerFunc> EngineDebugger::protocols;
void (*EngineDebugger::allow_focus_steal_fn)();
void EngineDebugger::register_profiler(const StringName &p_name, const Profiler &p_func) {

View file

@ -91,12 +91,12 @@ private:
uint32_t poll_every = 0;
protected:
static EngineDebugger *singleton;
static ScriptDebugger *script_debugger;
static inline EngineDebugger *singleton = nullptr;
static inline ScriptDebugger *script_debugger = nullptr;
static HashMap<StringName, Profiler> profilers;
static HashMap<StringName, Capture> captures;
static HashMap<String, CreatePeerFunc> protocols;
static inline HashMap<StringName, Profiler> profilers;
static inline HashMap<StringName, Capture> captures;
static inline HashMap<String, CreatePeerFunc> protocols;
static void (*allow_focus_steal_fn)();

View file

@ -32,9 +32,6 @@
#include "core/debugger/engine_debugger.h"
thread_local int ScriptDebugger::lines_left = -1;
thread_local int ScriptDebugger::depth = -1;
thread_local ScriptLanguage *ScriptDebugger::break_lang = nullptr;
thread_local Vector<ScriptDebugger::StackInfo> ScriptDebugger::error_stack_info;
void ScriptDebugger::set_lines_left(int p_left) {

View file

@ -43,9 +43,9 @@ class ScriptDebugger {
HashMap<int, HashSet<StringName>> breakpoints;
static thread_local int lines_left;
static thread_local int depth;
static thread_local ScriptLanguage *break_lang;
static inline thread_local int lines_left = -1;
static inline thread_local int depth = -1;
static inline thread_local ScriptLanguage *break_lang = nullptr;
static thread_local Vector<StackInfo> error_stack_info;
public: