| 218 | } |
| 219 | |
| 220 | void Profiler::reset() |
| 221 | { |
| 222 | mEnabled = false; // in case we're in a profiler call. |
| 223 | ProfilerData * head = mProfileList; |
| 224 | ProfilerData * curr = head; |
| 225 | |
| 226 | while ( curr ) |
| 227 | { |
| 228 | head = curr->mNextProfilerData; |
| 229 | free( curr ); |
| 230 | |
| 231 | if ( head ) |
| 232 | curr = head; |
| 233 | else |
| 234 | curr = NULL; |
| 235 | } |
| 236 | |
| 237 | mProfileList = NULL; |
| 238 | |
| 239 | for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot) |
| 240 | { |
| 241 | walk->mFirstProfilerData = 0; |
| 242 | walk->mTotalTime = 0; |
| 243 | walk->mSubTime = 0; |
| 244 | walk->mTotalInvokeCount = 0; |
| 245 | } |
| 246 | mCurrentProfilerData = mRootProfilerData; |
| 247 | mCurrentProfilerData->mNextForRoot = 0; |
| 248 | mCurrentProfilerData->mFirstChild = 0; |
| 249 | for(U32 i = 0; i < ProfilerData::HashTableSize; i++) |
| 250 | mCurrentProfilerData->mChildHash[i] = 0; |
| 251 | mCurrentProfilerData->mInvokeCount = 0; |
| 252 | mCurrentProfilerData->mTotalTime = 0; |
| 253 | mCurrentProfilerData->mSubTime = 0; |
| 254 | mCurrentProfilerData->mSubDepth = 0; |
| 255 | mCurrentProfilerData->mLastSeenProfiler = 0; |
| 256 | } |
| 257 | |
| 258 | static Profiler aProfiler; // allocate the global profiler |
| 259 |
no test coverage detected