summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-03-25 06:01:49 +1100
committer Vas Crabb <vas@vastheman.com>2023-03-25 06:01:49 +1100
commit395d41d0e9e93203c9c49ce4376a735f76de54b7 (patch)
tree50ba67c8b69b29b08defe1706fe658503a850560 /src
parent5f97af903c8bc7e3d4d031c9794cd620d3b2af98 (diff)
emu/profile.h: Hopefully convince clang that profile scope helpers are important even in non-profile builds.
Diffstat (limited to 'src')
-rw-r--r--src/emu/profiler.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/emu/profiler.h b/src/emu/profiler.h
index 1e672463e66..9145f4fb5f8 100644
--- a/src/emu/profiler.h
+++ b/src/emu/profiler.h
@@ -223,12 +223,15 @@ class dummy_profiler_state
public:
class scope
{
+ private:
+ dummy_profiler_state &m_host;
+
public:
scope(scope const &) = delete;
scope &operator=(scope const &) = delete;
scope(scope &&that) = default;
- scope(dummy_profiler_state &host, profile_type type) { }
- ~scope() = default;
+ scope(dummy_profiler_state &host, profile_type type) : m_host(host) { }
+ ~scope() { m_host.real_stop(); }
void stop() { }
};
@@ -244,6 +247,9 @@ public:
// start/stop
[[nodiscard]] auto start(profile_type type) { return scope(*this, type); }
+
+private:
+ void real_stop() { }
};