diff options
author | Keith Randall <khr@golang.org> | 2014-03-25 15:09:49 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2014-03-25 15:09:49 -0700 |
commit | af37c9cc0882b464a3e545edcb952a261f79a559 (patch) | |
tree | 6eb4f4512859ea2a3765e639cba521c84caf3306 /src/pkg/runtime/iface.goc | |
parent | a117fc0dd9bab5641603a083ae3584dc09983dd0 (diff) | |
download | go-af37c9cc0882b464a3e545edcb952a261f79a559.tar.gz |
runtime: WriteHeapDump dumps the heap to a file.
See http://golang.org/s/go13heapdump for the file format.
LGTM=rsc
R=rsc, bradfitz, dvyukov, khr
CC=golang-codereviews
https://codereview.appspot.com/37540043
Diffstat (limited to 'src/pkg/runtime/iface.goc')
-rw-r--r-- | src/pkg/runtime/iface.goc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pkg/runtime/iface.goc b/src/pkg/runtime/iface.goc index c678ce0a2..08da8c733 100644 --- a/src/pkg/runtime/iface.goc +++ b/src/pkg/runtime/iface.goc @@ -134,6 +134,20 @@ out: return m; } +// call the callback for every itab that is currently allocated. +void +runtime·iterate_itabs(void (*callback)(Itab*)) +{ + int32 i; + Itab *tab; + + for(i = 0; i < nelem(hash); i++) { + for(tab = hash[i]; tab != nil; tab = tab->link) { + callback(tab); + } + } +} + static void copyin(Type *t, void *src, void **dst) { |