aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/debug.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-07 09:57:22 -0400
committerRuss Cox <rsc@golang.org>2010-09-07 09:57:22 -0400
commitd4cc557b0d61ac02d0ff153ecd643867e803ed1f (patch)
treec8301a638fd5010bb90b6a6d415ec371c74ba3ce /src/pkg/runtime/debug.go
parent6f5f558c101a5948f1d90007fe93159804743bb6 (diff)
downloadgo-d4cc557b0d61ac02d0ff153ecd643867e803ed1f.tar.xz
runtime: use manual stack for garbage collection
Old code was using recursion to traverse object graph. New code uses an explicit stack, cutting the per-pointer footprint to two words during the recursion and avoiding the standard allocator and stack splitting code. in test/garbage: Reduces parser runtime by 2-3% Reduces Peano runtime by 40% Increases tree runtime by 4-5% R=r CC=golang-dev https://golang.org/cl/2150042
Diffstat (limited to 'src/pkg/runtime/debug.go')
-rw-r--r--src/pkg/runtime/debug.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pkg/runtime/debug.go b/src/pkg/runtime/debug.go
index b65cc66933..b5f6571faa 100644
--- a/src/pkg/runtime/debug.go
+++ b/src/pkg/runtime/debug.go
@@ -36,10 +36,11 @@ type MemStatsType struct {
Mallocs uint64 // number of mallocs
// Main allocation heap statistics.
- HeapAlloc uint64 // bytes allocated and still in use
- HeapSys uint64 // bytes obtained from system
- HeapIdle uint64 // bytes in idle spans
- HeapInuse uint64 // bytes in non-idle span
+ HeapAlloc uint64 // bytes allocated and still in use
+ HeapSys uint64 // bytes obtained from system
+ HeapIdle uint64 // bytes in idle spans
+ HeapInuse uint64 // bytes in non-idle span
+ HeapObjects uint64 // total number of allocated objects
// Low-level fixed-size structure allocator statistics.
// Inuse is bytes used now.