| func (n *Node) Line() string { |
| return Ctxt.LineHist.LineString(int(n.Lineno)) |
| func atoi(s string) int { |
| // NOTE: Not strconv.Atoi, accepts hex and octal prefixes. |
| n, _ := strconv.ParseInt(s, 0, 0) |
| atExitFuncs = append(atExitFuncs, f) |
| for i := len(atExitFuncs) - 1; i >= 0; i-- { |
| atExitFuncs = atExitFuncs[:i] |
| f, err := os.Create(cpuprofile) |
| if err := pprof.StartCPUProfile(f); err != nil { |
| AtExit(pprof.StopCPUProfile) |
| runtime.MemProfileRate = int(memprofilerate) |
| f, err := os.Create(memprofile) |
| runtime.GC() // profile all outstanding allocations |
| if err := pprof.WriteHeapProfile(f); err != nil { |