Add Tracy profiler support

This commit is contained in:
Wojtek Figat
2021-05-02 11:24:42 +02:00
parent 1a261597c5
commit 543d1a3c0e
45 changed files with 14752 additions and 108 deletions

View File

@@ -1,25 +0,0 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_PROFILER
#include "ProfilerMemory.h"
#include "ProfilerCPU.h"
void ProfilerMemory::OnAllocation(int32 bytes, bool isGC)
{
// Register allocation during the current CPU event
auto thread = ProfilerCPU::GetCurrentThread();
if (thread != nullptr && thread->Buffer.GetCount() != 0)
{
auto& activeEvent = thread->Buffer.Last().Event();
if (activeEvent.End < ZeroTolerance)
{
if (isGC)
activeEvent.ManagedMemoryAllocation += bytes;
else
activeEvent.NativeMemoryAllocation += bytes;
}
}
}
#endif