MCPcopy Create free account
hub / github.com/beefytech/Beef / Report

Method Report

BeefRT/dbg/gc.cpp:2356–2455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2354}
2355
2356void BFGC::Report()
2357{
2358 AutoCrit autoCrit(mCritSect);
2359
2360 CheckTcIntegrity();
2361
2362 BP_ZONE("Report");
2363
2364 Beefy::String msg;
2365
2366 int objectCount = 0;
2367
2368#ifdef BF_GC_VERIFY_SWEEP_IDS
2369 maxAllocNum = bf::System::Object::sCurAllocNum;
2370 allocIdSet.clear();
2371#endif
2372
2373 int leafCheckCount = 0;
2374 bool overflowed = false;
2375
2376 Dictionary<bf::System::Type*, AllocInfo> sizeMap;
2377 intptr objFreeSize = 0;
2378
2379 ObjReportScan(objectCount, objFreeSize, sizeMap);
2380
2381 std::multimap<AllocInfo, bf::System::Type*> orderedSizeMap;
2382 for (auto& pair : sizeMap)
2383 {
2384 orderedSizeMap.insert(std::make_pair(pair.mValue, pair.mKey));
2385 }
2386
2387 msg += "Overall GC Summary\n";
2388 //msg += Beefy::StrFormat(" TotalAllocs %d\n", mTotalAllocs);
2389 //msg += Beefy::StrFormat(" TotalAllocs - TotalFrees %d\n", mTotalAllocs - mTotalFrees);
2390 msg += Beefy::StrFormat(" System Memory Taken %dk\n", (int)(TCMalloc_SystemTaken / 1024));
2391 //msg += Beefy::StrFormat(" BytesRequested %dk\n", (int)(mBytesRequested / 1024));
2392 msg += Beefy::StrFormat(" Live Objects %d\n", objectCount);
2393 msg += Beefy::StrFormat(" Last Object Freed Count %d\n", mLastFreeCount);
2394
2395 intptr objReportedCount = 0;
2396 intptr rawReportedCount = 0;
2397 intptr rawFreeSize = 0;
2398 intptr objTotalSize = 0;
2399 intptr rawTotalSize = 0;
2400 gBFGC.RawReport(msg, rawFreeSize, orderedSizeMap);
2401 for (auto& pair : orderedSizeMap)
2402 {
2403 objTotalSize += pair.first.mObjSize;
2404 objReportedCount += pair.first.mObjCount;
2405 rawTotalSize += pair.first.mRawSize;
2406 rawReportedCount += pair.first.mRawCount;
2407 }
2408
2409 msg += Beefy::StrFormat(" Obj Scanned Alloc Count %d\n", (int)(objReportedCount));
2410 msg += Beefy::StrFormat(" Raw Scanned Alloc Count %d\n", (int)(rawReportedCount));
2411 msg += Beefy::StrFormat(" Obj Used Memory %dk\n", (int)(objTotalSize / 1024));
2412 msg += Beefy::StrFormat(" Raw Used Memory %dk\n", (int)(rawTotalSize / 1024));
2413 msg += Beefy::StrFormat(" Obj Unusued Memory %dk\n", (int)(objFreeSize / 1024));

Callers

nothing calls this directly

Calls 8

CheckTcIntegrityFunction · 0.85
BFGCLogWriteFunction · 0.85
RawReportMethod · 0.80
clearMethod · 0.45
IsEmptyMethod · 0.45
sizeMethod · 0.45
GetFullNameMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected