Skip to content

Commit c77ed8e

Browse files
bgoulddgryski
authored andcommitted
Added mstats fields
1 parent d1b7238 commit c77ed8e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/runtime/mstats.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ package runtime
99
type MemStats struct {
1010
// General statistics.
1111

12+
// Alloc is bytes of allocated heap objects.
13+
//
14+
// This is the same as HeapAlloc (see below).
15+
Alloc uint64
16+
1217
// Sys is the total bytes of memory obtained from the OS.
1318
//
1419
// Sys is the sum of the XSys fields below. Sys measures the
@@ -18,6 +23,19 @@ type MemStats struct {
1823

1924
// Heap memory statistics.
2025

26+
// HeapAlloc is bytes of allocated heap objects.
27+
//
28+
// "Allocated" heap objects include all reachable objects, as
29+
// well as unreachable objects that the garbage collector has
30+
// not yet freed. Specifically, HeapAlloc increases as heap
31+
// objects are allocated and decreases as the heap is swept
32+
// and unreachable objects are freed. Sweeping occurs
33+
// incrementally between GC cycles, so these two processes
34+
// occur simultaneously, and as a result HeapAlloc tends to
35+
// change smoothly (in contrast with the sawtooth that is
36+
// typical of stop-the-world garbage collectors).
37+
HeapAlloc uint64
38+
2139
// HeapSys is bytes of heap memory, total.
2240
//
2341
// In TinyGo unlike upstream Go, we make no distinction between

0 commit comments

Comments
 (0)