]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile: enable -d=zerocopy by default
authorMatthew Dempsky <mdempsky@google.com>
Fri, 18 Aug 2023 00:04:10 +0000 (17:04 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 18 Aug 2023 11:59:42 +0000 (11:59 +0000)
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>
src/cmd/compile/internal/base/flag.go
test/escape2.go
test/escape2n.go

index 1eb46e2369168a98137818a0a39d28778518159c..817dfd4ca51cd184d1f7aa2457a5b475a6fe3471 100644 (file)
@@ -181,6 +181,7 @@ func ParseFlags() {
        Debug.PGOInline = 1
        Debug.PGODevirtualize = 1
        Debug.SyncFrames = -1 // disable sync markers by default
+       Debug.ZeroCopy = 1
 
        Debug.Checkptr = -1 // so we can tell whether it is set explicitly
 
index e3e5904cde525bc9b4c2412a1c52b5764e23f837..99f85914a32ed7caa1d3addaf444ff45e4b63ddf 100644 (file)
@@ -1729,7 +1729,7 @@ func intstring2() {
 
 func stringtoslicebyte0() {
        s := "foo"
-       x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$"
+       x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$" "zero-copy string->\[\]byte conversion"
        _ = x
 }
 
index 57cc1a01639eb410656caaba1e6bc092c4b59d0e..350be65202c00b14b24ce9ad258842554a1d9268 100644 (file)
@@ -1729,7 +1729,7 @@ func intstring2() {
 
 func stringtoslicebyte0() {
        s := "foo"
-       x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$"
+       x := []byte(s) // ERROR "\(\[\]byte\)\(s\) does not escape$" "zero-copy string->\[\]byte conversion"
        _ = x
 }