aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/mstats.go
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-09 22:52:24 -0700
committerRon Evans <[email protected]>2022-08-20 11:41:20 +0200
commit697e8c725b069d87488ad9418fe2a95a294328a1 (patch)
treef4f3f53e929086c0f662014116cb5de4fb33c585 /src/runtime/mstats.go
parenta87e5cdbf0c823cf8fd71f8c9636b802545174d3 (diff)
downloadtinygo-697e8c725b069d87488ad9418fe2a95a294328a1.tar.gz
tinygo-697e8c725b069d87488ad9418fe2a95a294328a1.zip
runtime: add MemStats.Mallocs and Frees
Diffstat (limited to 'src/runtime/mstats.go')
-rw-r--r--src/runtime/mstats.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/mstats.go b/src/runtime/mstats.go
index 6a43c8444..2699e08b3 100644
--- a/src/runtime/mstats.go
+++ b/src/runtime/mstats.go
@@ -42,6 +42,13 @@ type MemStats struct {
// objects are freed.
TotalAlloc uint64
+ // Mallocs is the cumulative count of heap objects allocated.
+ // The number of live objects is Mallocs - Frees.
+ Mallocs uint64
+
+ // Frees is the cumulative count of heap objects freed.
+ Frees uint64
+
// Off-heap memory statistics.
//
// The following statistics measure runtime-internal