MCPcopy Create free account
hub / github.com/defold/defold / DumpBacktracePlatform

Function DumpBacktracePlatform

engine/dlib/src/dlib/memprofile.cpp:320–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318 }
319
320 void DumpBacktracePlatform(int file)
321 {
322 char buf[256];
323 const int maxbt = 32;
324 void* backt[maxbt];
325
326 uintptr_t app_start = dmMemProfile::g_BaseAddress;
327 uintptr_t app_end = app_start + dmMemProfile::g_AppSize;
328
329 int n_bt = backtrace(backt, maxbt);
330
331 for (int i = 0; i < n_bt; ++i)
332 {
333 uintptr_t addr = (uintptr_t)backt[i];
334 if (addr >= app_start && addr < app_end)
335 {
336 addr -= app_start;
337 }
338 snprintf(buf, sizeof(buf), "%p ", (void*)addr);
339 Log(file, buf);
340 }
341 }
342
343 void DumpBacktrace(char type, void* ptr, uint32_t size)
344 {

Callers 1

DumpBacktraceFunction · 0.85

Calls 1

LogFunction · 0.70

Tested by

no test coverage detected