Code cleanup

This commit is contained in:
Victor Olin 2023-03-21 17:06:10 +01:00
parent 8081bc5d67
commit 7105c570d9
9 changed files with 106 additions and 138 deletions

View file

@ -9,30 +9,32 @@ namespace GC {
class Profiler {
private:
Profiler() { }
~Profiler() {
Profiler() {}
~Profiler()
{
for (GCEvent *c : m_events)
delete c;
}
inline static Profiler *the() {
static Profiler *the()
{
if (m_instance)
return m_instance;
m_instance = new Profiler();
return m_instance;
}
inline static Profiler *m_instance = nullptr;
inline static Profiler *m_instance {nullptr};
std::vector<GCEvent *> m_events;
std::ofstream create_file_stream();
std::string get_log_folder();
std::string get_log_folder();
static void dump_trace();
public:
static void record(GCEventType type);
static void record(GCEventType type, size_t size);
static void record(GCEventType type, Chunk *chunk);
static void dump_trace();
static void dispose();
};
}