1
0
mirror of https://github.com/golang/go synced 2024-10-05 05:11:25 -06:00
go/src/cmd
Ian Lance Taylor 8b4deb448e cmd/compile: fix OADDSTR buffer size calculation
The size calculation has been wrong since this code was first committed
in https://golang.org/cl/3120.  The effect was that the compiler always
allocated a temporary buffer on the stack for a non-escaping string
concatenation.  This turns out to make no practical difference, as the
compiler always allocates a buffer of the same size (32 bytes) and the
runtime only uses the temporary buffer if the concatenated strings
fit (check is in rawstringtmp in runtime/string.go).

The effect of this change is to avoid generating a temporary buffer on
the stack that will not be used.

Change-Id: Id632bfe3d6c113c9934c018a2dd4bcbf1784a63d
Reviewed-on: https://go-review.googlesource.com/20112
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-02 00:04:53 +00:00
..
addr2line cmd/addr2line: simplify windows test 2015-06-17 14:23:20 +00:00
api all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
compile cmd/compile: fix OADDSTR buffer size calculation 2016-03-02 00:04:53 +00:00
cover all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
dist all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
doc all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
fix all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
gofmt all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
internal all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
link all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
newlink all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
nm all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
objdump cmd/objdump: skip TestDisasm* for mips64{,le} 2015-09-10 18:27:09 +00:00
pack all: extract "can I exec?" check from tests into internal/testenv 2015-06-16 18:07:36 +00:00
pprof all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
trace all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
vet all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
yacc cmd/yacc: memory allocation improvements 2015-11-26 17:42:14 +00:00