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

Method constructProfilePath

Engine/source/platform/profiler.cpp:263–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261
262#ifdef TORQUE_ENABLE_PROFILE_PATH
263const 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
292void Profiler::hashPush(ProfilerRootData *root)
293{

Callers

nothing calls this directly

Calls 5

allocFunction · 0.85
dStrcpyFunction · 0.85
dStrcatFunction · 0.85
dStrlenFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected