MCPcopy Create free account
hub / github.com/defold/defold / FindOrCreateProfilerThread

Function FindOrCreateProfilerThread

engine/profiler/src/profiler_render.cpp:888–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886 }
887
888 ProfilerThread* FindOrCreateProfilerThread(ProfilerFrame* ctx, uint32_t name_hash)
889 {
890 ProfilerThread* thread = FindProfilerThread(ctx, name_hash);
891 if (thread != 0)
892 return thread;
893
894 thread = new ProfilerThread;
895 thread->m_NameHash = name_hash;
896 thread->m_Samples.SetCapacity(1); //TODO: Increase!!
897
898 if (ctx->m_Threads.Full())
899 ctx->m_Threads.OffsetCapacity(8);
900 ctx->m_Threads.Push(thread);
901 return thread;
902 }
903
904 void ClearProfilerThreadSamples(ProfilerThread* thread)
905 {

Callers 2

SampleTreeCallbackFunction · 0.85
CreateProfilerFrameFunction · 0.85

Calls 5

FindProfilerThreadFunction · 0.85
SetCapacityMethod · 0.45
FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by 1

CreateProfilerFrameFunction · 0.68