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

Function GetOrCreateLuaProfilerScopeState

engine/profiler/src/profiler.cpp:108–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static LuaProfilerScopeState* GetOrCreateLuaProfilerScopeState(lua_State* L)
109{
110 LuaProfilerScopeState* state = FindLuaProfilerScopeState(L);
111 if (state != 0)
112 {
113 return state;
114 }
115
116 state = new LuaProfilerScopeState;
117 state->m_L = L;
118 state->m_IsMainThread = L == dmScript::GetMainThread(L);
119 state->m_Scopes.SetCapacity(4);
120 state->m_Names.SetCapacity(64);
121 state->m_Next = g_LuaProfilerScopeStates;
122 g_LuaProfilerScopeStates = state;
123 return state;
124}
125
126static void DeleteLuaProfilerScopeState(LuaProfilerScopeState* delete_state)
127{

Callers 1

PushLuaProfilerScopeFunction · 0.85

Calls 3

GetMainThreadFunction · 0.85
SetCapacityMethod · 0.45

Tested by

no test coverage detected