From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- source/core/slang-performance-profiler.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source/core/slang-performance-profiler.h') diff --git a/source/core/slang-performance-profiler.h b/source/core/slang-performance-profiler.h index 9895793c4..40ace4e6d 100644 --- a/source/core/slang-performance-profiler.h +++ b/source/core/slang-performance-profiler.h @@ -1,11 +1,12 @@ #ifndef SLANG_CORE_PERFORMANCE_PROFILER_H #define SLANG_CORE_PERFORMANCE_PROFILER_H +#include "../core/slang-list.h" +#include "slang-com-helper.h" #include "slang-string.h" + #include #include -#include "slang-com-helper.h" -#include "../core/slang-list.h" namespace Slang { @@ -30,6 +31,7 @@ public: virtual void getResult(StringBuilder& out) = 0; virtual void clear() = 0; virtual void dispose() = 0; + public: static PerformanceProfiler* getProfiler(); }; @@ -47,7 +49,7 @@ struct PerformanceProfilerFuncRAIIContext } }; -struct SlangProfiler: public ISlangProfiler, public RefObject +struct SlangProfiler : public ISlangProfiler, public RefObject { public: SLANG_REF_OBJECT_IUNKNOWN_ALL @@ -57,20 +59,21 @@ public: int invocationCount = 0; std::chrono::nanoseconds duration = std::chrono::nanoseconds::zero(); }; - SlangProfiler(PerformanceProfiler * profiler); + SlangProfiler(PerformanceProfiler* profiler); ISlangUnknown* getInterface(const Guid& guid); virtual SLANG_NO_THROW size_t SLANG_MCALL getEntryCount() override; virtual SLANG_NO_THROW const char* SLANG_MCALL getEntryName(uint32_t index) override; virtual SLANG_NO_THROW long SLANG_MCALL getEntryTimeMS(uint32_t index) override; virtual SLANG_NO_THROW uint32_t SLANG_MCALL getEntryInvocationTimes(uint32_t index) override; + private: List m_profilEntries; }; -#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) +#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) #define SLANG_PROFILE_SECTION(s) PerformanceProfilerFuncRAIIContext _profileContext##s(#s) -} +} // namespace Slang #endif -- cgit v1.2.3