aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2024-10-08 09:12:01 -0700
committerDamian Gryski <[email protected]>2024-10-09 07:01:09 -0700
commit87c6e19921ae916a7af53e1695e37995aa112607 (patch)
treeee81b9c25132574ef91e58fc6b15631b3eb87710 /src
parent62c1555aa867508ebf443a7d6c3b61756c7fe368 (diff)
downloadtinygo-87c6e19921ae916a7af53e1695e37995aa112607.tar.gz
tinygo-87c6e19921ae916a7af53e1695e37995aa112607.zip
runtime: add HeapAlloc to gc_leaking
Diffstat (limited to 'src')
-rw-r--r--src/runtime/gc_leaking.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/gc_leaking.go b/src/runtime/gc_leaking.go
index 5c9594277..71c4258b6 100644
--- a/src/runtime/gc_leaking.go
+++ b/src/runtime/gc_leaking.go
@@ -79,6 +79,9 @@ func ReadMemStats(m *MemStats) {
m.Mallocs = gcMallocs
m.Frees = gcFrees
m.Sys = uint64(heapEnd - heapStart)
+ // no free -- current in use heap is the total allocated
+ m.HeapAlloc = gcTotalAlloc
+ m.Alloc = m.HeapAlloc
}
func GC() {