MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / gc_format_breakdown

Function gc_format_breakdown

src/ast/ast_gc_report.cpp:92–104  ·  view source on GitHub ↗

"[Expr 1200, TypeDecl 900]" — nonzero tags, descending by count.

Source from the content-addressed store, hash-verified

90
91 // "[Expr 1200, TypeDecl 900]" — nonzero tags, descending by count.
92 static void gc_format_breakdown ( const TagCounts & c, TextWriter & out ) {
93 vector<pair<uint16_t,uint64_t>> v;
94 for ( uint16_t t=0; t<16; ++t ) if ( c.n[t] ) v.push_back({t, c.n[t]});
95 sort(v.begin(), v.end(), [](const pair<uint16_t,uint64_t> & a, const pair<uint16_t,uint64_t> & b){
96 return a.second > b.second;
97 });
98 out << "[";
99 for ( size_t i=0; i<v.size(); ++i ) {
100 if ( i ) out << ", ";
101 out << gc_tag_name(v[i].first) << " " << v[i].second;
102 }
103 out << "]";
104 }
105
106 void gcReportHistogram ( const gc_root & root, const char * label, TextWriter & out, uint64_t minCount ) {
107 Histogram histo;

Callers 1

gcReportHistogramFunction · 0.85

Calls 6

sortFunction · 0.85
gc_tag_nameFunction · 0.85
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected