• David Chase's avatar
    cmd/internal/gc: extend escape analysis to pointers in slices · a21cf5b6
    David Chase authored
    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/10118Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    a21cf5b6
escape_slice.go 3.79 KB