mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-31 17:59:03 +00:00
338af91ae6
Reading runtime.MemStats.NumGC is common enough in dependency code that its absence is a compile error for programs that never look at the value. Rather than add the field as a constant zero, track it: - gc_blocks: count completed cycles in runGC, so collections triggered by an allocation are counted as well as explicit runtime.GC() calls. The counter is read and written under gcLock, like the other counters beside it. - gc_boehm: report bdwgc's own gc_no from the prof_stats struct. - gc_leaking: always 0, since that collector never completes a cycle.