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

Function gc_build_histogram

src/ast/ast_gc_report.cpp:77–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 }
76
77 static void gc_build_histogram ( const gc_root & root, Histogram & histo ) {
78 for ( auto node = root.gc_first; node; node = node->gc_next ) {
79 uint16_t tag = node->gc_type_tag();
80 const LineInfo * li = gc_node_at(node);
81 string key;
82 uint32_t line = 0;
83 if ( li && li->fileInfo ) { key = li->fileInfo->name; line = li->line; }
84 else { key = "<no source>"; }
85 auto & fb = histo[key];
86 fb.total.add(tag);
87 fb.byLine[line].add(tag);
88 }
89 }
90
91 // "[Expr 1200, TypeDecl 900]" — nonzero tags, descending by count.
92 static void gc_format_breakdown ( const TagCounts & c, TextWriter & out ) {

Callers 2

gcReportHistogramFunction · 0.85
gcStageReportDeltaFunction · 0.85

Calls 2

gc_node_atFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected