diff options
author | Russ Cox <rsc@golang.org> | 2010-02-08 14:32:22 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-02-08 14:32:22 -0800 |
commit | efc07e53e25a0bdbcf9564b8582d0f14206caf69 (patch) | |
tree | b0c44e6fe88273223814fc86db6ad41e74039974 /src/pkg/runtime/malloc.h | |
parent | 2ad0035daa6c682ebfd681288a87940d06fd45d5 (diff) | |
download | golang-efc07e53e25a0bdbcf9564b8582d0f14206caf69.tar.gz |
runtime: instrument malloc + garbage collector.
add simple garbage collection benchmark.
R=iant
CC=golang-dev
http://codereview.appspot.com/204053
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r-- | src/pkg/runtime/malloc.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index 133ed0232..05f500a1e 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -156,17 +156,26 @@ void FixAlloc_Free(FixAlloc *f, void *p); // Statistics. -// Shared with Go: if you edit this structure, also edit ../malloc/malloc.go. +// Shared with Go: if you edit this structure, also edit extern.go. struct MStats { uint64 alloc; + uint64 total_alloc; uint64 sys; uint64 stacks; uint64 inuse_pages; // protected by mheap.Lock uint64 next_gc; // protected by mheap.Lock uint64 nlookup; // unprotected (approximate) uint64 nmalloc; // unprotected (approximate) + uint64 pause_ns; + uint32 numgc; bool enablegc; + bool debuggc; + struct { + uint32 size; + uint64 nmalloc; + uint64 nfree; + } by_size[NumSizeClasses]; }; #define mstats ·MemStats /* name shared with Go */ |