diff options
| author | Martin Möhrmann <moehrmann@google.com> | 2018-10-14 22:28:58 +0200 |
|---|---|---|
| committer | Martin Möhrmann <martisch@uos.de> | 2018-10-29 19:23:00 +0000 |
| commit | 020a18c545bf49ffc087ca93cd238195d8dcc411 (patch) | |
| tree | 0d9aba99dc40be4eb38f00a7a2a8c6cef93cee8f /src/runtime/runtime-gdb_test.go | |
| parent | c86d4647348b420f55d4ce7572c4cd93b20a1d4a (diff) | |
| download | go-020a18c545bf49ffc087ca93cd238195d8dcc411.tar.xz | |
cmd/compile: move slice construction to callers of makeslice
Only return a pointer p to the new slices backing array from makeslice.
Makeslice callers then construct sliceheader{p, len, cap} explictly
instead of makeslice returning the slice.
Reduces go binary size by ~0.2%.
Removes 92 (~3.5%) panicindex calls from go binary.
Change-Id: I29b7c3b5fe8b9dcec96e2c43730575071cfe8a94
Reviewed-on: https://go-review.googlesource.com/c/141822
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
| -rw-r--r-- | src/runtime/runtime-gdb_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index 0c24d3dce6..ee63285ec5 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -266,8 +266,11 @@ func testGdbPython(t *testing.T, cgo bool) { infoLocalsRe1 := regexp.MustCompile(`slicevar *= *\[\]string *= *{"def"}`) // Format output from gdb v8.2 infoLocalsRe2 := regexp.MustCompile(`^slicevar = .*\nmapvar = .*\nstrvar = 0x[0-9a-f]+ "abc"`) + // Format output from gdb v7.7 + infoLocalsRe3 := regexp.MustCompile(`^mapvar = .*\nstrvar = "abc"\nslicevar *= *\[\]string`) if bl := blocks["info locals"]; !infoLocalsRe1.MatchString(bl) && - !infoLocalsRe2.MatchString(bl) { + !infoLocalsRe2.MatchString(bl) && + !infoLocalsRe3.MatchString(bl) { t.Fatalf("info locals failed: %s", bl) } |
