Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
havlak3
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Feb 3, 2017
1 parent 58ac27b commit b78dac1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions havlak/havlak.go
Expand Up @@ -671,6 +671,7 @@ func buildBaseLoop(cfgraph *CFG, from int) int {
}

var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
var memprofile = flag.String("memprofile", "", "write memory profile to this file")

func main() {
flag.Parse()
Expand Down Expand Up @@ -716,6 +717,15 @@ func main() {
}

FindHavlakLoops(cfgraph, lsgraph)
if *memprofile != "" {
f, err := os.Create(*memprofile)
if err != nil {
log.Fatal(err)
}
pprof.WriteHeapProfile(f)
f.Close()
return
}

for i := 0; i < 50; i++ {
FindHavlakLoops(cfgraph, NewLSG())
Expand Down

0 comments on commit b78dac1

Please sign in to comment.