Skip to content

Commit d63c88d

Browse files
mdempskygopherbot
authored andcommitted
cmd/compile: enable -d=zerocopy by default
Fixes #2205. Change-Id: Ib0802fee2b274798b35f0ebbd0b736b1be5ae00a Reviewed-on: https://go-review.googlesource.com/c/go/+/520600 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
1 parent 925d2fb commit d63c88d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/cmd/compile/internal/base/flag.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func ParseFlags() {
181181
Debug.PGOInline = 1
182182
Debug.PGODevirtualize = 1
183183
Debug.SyncFrames = -1 // disable sync markers by default
184+
Debug.ZeroCopy = 1
184185

185186
Debug.Checkptr = -1 // so we can tell whether it is set explicitly
186187

test/escape2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ func intstring2() {
17291729

17301730
func stringtoslicebyte0() {
17311731
s := "foo"
1732-
x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$"
1732+
x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$" "zero-copy string->\[\]byte conversion"
17331733
_ = x
17341734
}
17351735

test/escape2n.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ func intstring2() {
17291729

17301730
func stringtoslicebyte0() {
17311731
s := "foo"
1732-
x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$"
1732+
x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$" "zero-copy string->\[\]byte conversion"
17331733
_ = x
17341734
}
17351735

0 commit comments

Comments
 (0)