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

Commit b78dac1

Browse files
committed
havlak3
1 parent 58ac27b commit b78dac1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎havlak/havlak.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ func buildBaseLoop(cfgraph *CFG, from int) int {
671671
}
672672

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

675676
func main() {
676677
flag.Parse()
@@ -716,6 +717,15 @@ func main() {
716717
}
717718

718719
FindHavlakLoops(cfgraph, lsgraph)
720+
if *memprofile != "" {
721+
f, err := os.Create(*memprofile)
722+
if err != nil {
723+
log.Fatal(err)
724+
}
725+
pprof.WriteHeapProfile(f)
726+
f.Close()
727+
return
728+
}
719729

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

0 commit comments

Comments
 (0)