mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
runtime: add MemStats.TotalAlloc
This commit is contained in:
@@ -9,10 +9,11 @@ package runtime
|
||||
// call to ReadMemStats. This would not do GC implicitly for you.
|
||||
func ReadMemStats(m *MemStats) {
|
||||
m.HeapIdle = 0
|
||||
m.HeapInuse = uint64(heapptr - heapStart)
|
||||
m.HeapInuse = gcTotalAlloc
|
||||
m.HeapReleased = 0 // always 0, we don't currently release memory back to the OS.
|
||||
|
||||
m.HeapSys = m.HeapInuse + m.HeapIdle
|
||||
m.GCSys = 0
|
||||
m.TotalAlloc = gcTotalAlloc
|
||||
m.Sys = uint64(heapEnd - heapStart)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user