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

Method WriteDebugDumpState

BeefRT/dbg/gc.cpp:2631–2726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2629}
2630
2631void BFGC::WriteDebugDumpState()
2632{
2633 struct DebugInfo
2634 {
2635 bf::System::Type* mType;
2636 int mCount;
2637 int mSize;
2638 int mAllocSize;
2639
2640 DebugInfo()
2641 {
2642 mType = NULL;
2643 mCount = 0;
2644 mSize = 0;
2645 mAllocSize = 0;
2646 }
2647 };
2648
2649 std::vector<DebugInfo> debugInfoVector;
2650 for (int i = 0; i < (int)mFinalizeList.size(); i++)
2651 {
2652 bf::System::Object* obj = (bf::System::Object*) mFinalizeList[i];
2653
2654 if ((bf::System::Type*)obj->GetTypeSafe() != NULL)
2655 {
2656 if ((uintptr)obj->GetTypeSafe() <= 1024U*1024U)
2657 {
2658 while ((int) debugInfoVector.size() <= 0)
2659 debugInfoVector.push_back(DebugInfo());
2660
2661 DebugInfo* debugInfo = &debugInfoVector[0];
2662 debugInfo->mType = NULL;
2663 debugInfo->mCount++;
2664 int objSize = BFGetObjectSize(obj);
2665 debugInfo->mSize += objSize;
2666 debugInfo->mAllocSize += objSize;
2667 //debugInfo->mAllocSize += MallocExtension::instance()->GetEstimatedAllocatedSize(objSize);
2668 }
2669 else
2670 {
2671 //const bf::System::Type* bfTypeRootData = ((bf::System::Type*)obj->GetTypeSafe())->mTypeRootData;
2672 bf::System::Type* bfType = obj->GetTypeSafe();
2673
2674 auto typeData = bfType->GetTypeData();
2675
2676 while ((int) debugInfoVector.size() <= typeData->mTypeId)
2677 debugInfoVector.push_back(DebugInfo());
2678
2679 DebugInfo* debugInfo = &debugInfoVector[typeData->mTypeId];
2680 debugInfo->mType = obj->GetTypeSafe();
2681 debugInfo->mCount++;
2682 int objSize = BFGetObjectSize(obj);
2683 debugInfo->mSize += objSize;
2684 debugInfo->mAllocSize += objSize;
2685 //debugInfo->mAllocSize += MallocExtension::instance()->GetEstimatedAllocatedSize(objSize);
2686 }
2687 }
2688 }

Callers

nothing calls this directly

Calls 10

DebugInfoClass · 0.85
BFGetObjectSizeFunction · 0.85
GetTypeSafeMethod · 0.80
GetTypeDataMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetFullNameMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected