Commit graph

2 commits

Author SHA1 Message Date
David Chase a21cf5b6a2 cmd/internal/gc: extend escape analysis to pointers in slices
Modified esc.go to allow slice literals (before append)
to be non-escaping.  Modified tests to account for changes
in escape behavior and to also test the two cases that
were previously not tested.

Also minor cleanups to debug-printing within esc.go

Allocation stats for running compiler
( cd src/html/template;
  for i in {1..5} ; do
     go tool 6g -memprofile=testzz.${i}.prof  -memprofilerate=1 *.go ;
     go tool pprof -alloc_objects -text  testzz.${i}.prof ;
     done ; )
before about 86k allocations
after  about 83k allocations

Fixes #8972

Change-Id: Ib61dd70dc74adb40d6f6fdda6eaa4bf7d83481de
Reviewed-on: https://go-review.googlesource.com/10118
Reviewed-by: Russ Cox <rsc@golang.org>
2015-05-18 15:34:39 +00:00
Dmitry Vyukov 0558f12123 test: add tests for escape analysis of slices
False positives (var incorrectly escapes) are marked with BAD.

Change-Id: I9e9a3f71b060520103bcf289829a2efdf6f2b517
Reviewed-on: https://go-review.googlesource.com/5298
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-28 13:18:42 +00:00