diff options
author | Damian Gryski <[email protected]> | 2022-08-09 22:52:24 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-08-20 11:41:20 +0200 |
commit | 697e8c725b069d87488ad9418fe2a95a294328a1 (patch) | |
tree | f4f3f53e929086c0f662014116cb5de4fb33c585 /src/runtime/mstats.go | |
parent | a87e5cdbf0c823cf8fd71f8c9636b802545174d3 (diff) | |
download | tinygo-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.go | 7 |
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 |