| 261 | |
| 262 | #ifdef TORQUE_ENABLE_PROFILE_PATH |
| 263 | const char * Profiler::constructProfilePath(ProfilerData * pd) |
| 264 | { |
| 265 | if (pd->mParent) |
| 266 | { |
| 267 | const bool saveEnable = gProfiler->mEnabled; |
| 268 | gProfiler->mEnabled = false; |
| 269 | |
| 270 | const char * connector = " -> "; |
| 271 | U32 len = dStrlen(pd->mParent->mPath); |
| 272 | if (!len) |
| 273 | connector = ""; |
| 274 | len += dStrlen(connector); |
| 275 | len += dStrlen(pd->mRoot->mName); |
| 276 | |
| 277 | U32 mark = FrameAllocator::getWaterMark(); |
| 278 | char * buf = (char*)FrameAllocator::alloc(len+1); |
| 279 | dStrcpy(buf,pd->mParent->mPath,len+1); |
| 280 | dStrcat(buf,connector,len+1); |
| 281 | dStrcat(buf,pd->mRoot->mName,len+1); |
| 282 | const char * ret = StringTable->insert(buf); |
| 283 | FrameAllocator::setWaterMark(mark); |
| 284 | |
| 285 | gProfiler->mEnabled = saveEnable; |
| 286 | |
| 287 | return ret; |
| 288 | } |
| 289 | return "root"; |
| 290 | } |
| 291 | #endif |
| 292 | void Profiler::hashPush(ProfilerRootData *root) |
| 293 | { |