runtime: add MemStats.Mallocs and Frees

This commit is contained in:
Damian Gryski
2022-08-09 22:52:24 -07:00
committed by Ron Evans
parent a87e5cdbf0
commit 697e8c725b
6 changed files with 25 additions and 1 deletions
+7
View File
@@ -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