| 166 | } |
| 167 | |
| 168 | void 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 | |
| 206 | static Profiler aProfiler; // allocate the global profiler |
| 207 |
no test coverage detected