MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / reset

Method reset

Engine/source/platform/profiler.cpp:168–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void Profiler::reset()
169{
170 mEnabled = false; // in case we're in a profiler call.
171 ProfilerData * head = mProfileList;
172 ProfilerData * curr = head;
173
174 while ( curr )
175 {
176 head = curr->mNextProfilerData;
177 free( curr );
178
179 if ( head )
180 curr = head;
181 else
182 curr = NULL;
183 }
184
185 mProfileList = NULL;
186
187 for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
188 {
189 walk->mFirstProfilerData = 0;
190 walk->mTotalTime = 0;
191 walk->mSubTime = 0;
192 walk->mTotalInvokeCount = 0;
193 }
194 mCurrentProfilerData = mRootProfilerData;
195 mCurrentProfilerData->mNextForRoot = 0;
196 mCurrentProfilerData->mFirstChild = 0;
197 for(U32 i = 0; i < ProfilerData::HashTableSize; i++)
198 mCurrentProfilerData->mChildHash[i] = 0;
199 mCurrentProfilerData->mInvokeCount = 0;
200 mCurrentProfilerData->mTotalTime = 0;
201 mCurrentProfilerData->mSubTime = 0;
202 mCurrentProfilerData->mSubDepth = 0;
203 mCurrentProfilerData->mLastSeenProfiler = 0;
204}
205
206static Profiler aProfiler; // allocate the global profiler
207

Callers 2

profiler.cppFile · 0.45
_updateTimeMethod · 0.45

Calls 1

freeFunction · 0.85

Tested by

no test coverage detected