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

Method Report

IDEHelper/Compiler/MemReporter.cpp:27–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void MemReporter::Report(int depth, Entry* entry)
28{
29 String str;
30 for (int i = 0; i < depth; i++)
31 str += " ";
32
33 str += entry->mName;
34 while (str.length() < 64)
35 str += ' ';
36
37 if (entry->mChildSize == -1)
38 entry->mChildSize = GetChildSizes(entry);
39
40 if (mShowInKB)
41 str += StrFormat("%6d %6dk %6dk\r\n", entry->mCount, entry->mSize / 1024, (entry->mSize + entry->mChildSize) / 1024);
42 else
43 str += StrFormat("%6d %6d %6d\r\n", entry->mCount, entry->mSize, (entry->mSize + entry->mChildSize));
44 BfpOutput_DebugString(str.c_str());
45
46 Array<Entry*> entries;
47 for (auto& kv : entry->mChildren)
48 {
49 auto* entry = kv.mValue;
50 entry->mChildSize = GetChildSizes(entry);
51 entries.Add(kv.mValue);
52 }
53
54 entries.Sort([](Entry* lhs, Entry* rhs) { return (lhs->mSize + lhs->mChildSize) > (rhs->mSize + rhs->mChildSize); });
55
56 for (auto& entry : entries)
57 {
58 Report(depth + 1, entry);
59 }
60}
61
62void MemReporter::BeginSection(const StringView& name)
63{

Callers 3

BfFullReportMemoryFunction · 0.45
ReadCOFFMethod · 0.45
BfSystem_ReportMemoryFunction · 0.45

Calls 5

BfpOutput_DebugStringFunction · 0.50
lengthMethod · 0.45
c_strMethod · 0.45
AddMethod · 0.45
SortMethod · 0.45

Tested by

no test coverage detected