diff options
| author | Russ Cox <rsc@golang.org> | 2010-09-07 09:57:22 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-09-07 09:57:22 -0400 |
| commit | d4cc557b0d61ac02d0ff153ecd643867e803ed1f (patch) | |
| tree | c8301a638fd5010bb90b6a6d415ec371c74ba3ce /src/pkg/runtime/malloc.h | |
| parent | 6f5f558c101a5948f1d90007fe93159804743bb6 (diff) | |
| download | go-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/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index 473e8a836f..d7ee2535de 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -183,6 +183,7 @@ struct MStats uint64 heap_sys; // bytes obtained from system uint64 heap_idle; // bytes in idle spans uint64 heap_inuse; // bytes in non-idle spans + uint64 heap_objects; // total number of allocated objects // Statistics about allocation of low-level fixed-size structures. // Protected by FixAlloc locks. @@ -251,6 +252,7 @@ struct MCache MCacheList list[NumSizeClasses]; uint64 size; int64 local_alloc; // bytes allocated (or freed) since last lock of heap + int64 local_objects; // objects allocated (or freed) since last lock of heap int32 next_sample; // trigger heap sample after allocating this many bytes }; |
