| 106 | } |
| 107 | |
| 108 | static 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 | |
| 126 | static void DeleteLuaProfilerScopeState(LuaProfilerScopeState* delete_state) |
| 127 | { |
no test coverage detected