OLD | NEW |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package debug | 5 package debug |
6 | 6 |
7 import ( | 7 import ( |
8 "runtime" | 8 "runtime" |
9 "sort" | 9 "sort" |
10 "time" | 10 "time" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // SetPanicOnFault controls the runtime's behavior when a program faults | 139 // SetPanicOnFault controls the runtime's behavior when a program faults |
140 // at an unexpected (non-nil) address. Such faults are typically caused by | 140 // at an unexpected (non-nil) address. Such faults are typically caused by |
141 // bugs such as runtime memory corruption, so the default response is to crash | 141 // bugs such as runtime memory corruption, so the default response is to crash |
142 // the program. Programs working with memory-mapped files or unsafe | 142 // the program. Programs working with memory-mapped files or unsafe |
143 // manipulation of memory may cause faults at non-nil addresses in less | 143 // manipulation of memory may cause faults at non-nil addresses in less |
144 // dramatic situations; SetPanicOnFault allows such programs to request | 144 // dramatic situations; SetPanicOnFault allows such programs to request |
145 // that the runtime trigger only a panic, not a crash. | 145 // that the runtime trigger only a panic, not a crash. |
146 // SetPanicOnFault applies only to the current goroutine. | 146 // SetPanicOnFault applies only to the current goroutine. |
147 // It returns the previous setting. | 147 // It returns the previous setting. |
148 func SetPanicOnFault(enabled bool) bool | 148 func SetPanicOnFault(enabled bool) bool |
| 149 |
| 150 // WriteHeapDump writes a description of the heap and the objects in |
| 151 // it to the given file descriptor. |
| 152 func WriteHeapDump(fd uintptr) |
OLD | NEW |