]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/ld: add -extld and -extldflags options
Ian Lance Taylor [Mon, 1 Apr 2013 19:56:18 +0000 (12:56 -0700)]
cmd/ld: add -extld and -extldflags options

Permits specifying the linker to use, and trailing flags to
pass to that linker, when linking in external mode.  External
mode linking is used when building a package that uses cgo, as
described in the cgo docs.

Also document -linkmode and -tmpdir.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8225043

12 years agocmd/gc: do not reuse bool temporaries for composite equality.
Rémy Oudompheng [Mon, 1 Apr 2013 19:01:50 +0000 (21:01 +0200)]
cmd/gc: do not reuse bool temporaries for composite equality.

Reusing it when multiple comparisons occurred in the same
function call led to bad overwriting.

Fixes #5162.

R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/8174047

12 years agoruntime: add concurrent map read test
Brad Fitzpatrick [Mon, 1 Apr 2013 18:49:24 +0000 (11:49 -0700)]
runtime: add concurrent map read test

Currently crashes, so disabled.

Update #5179

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/8222044

12 years agocmd/go: prevent packages from being cleaned more than once
Lucio De Re [Mon, 1 Apr 2013 17:01:12 +0000 (10:01 -0700)]
cmd/go: prevent packages from being cleaned more than once

If a package was listed as a dependency from multiple places, it
could have been cleaned repeatedly.

R=golang-dev, dave, rsc, seed, bradfitz
CC=golang-dev, minux.ma
https://golang.org/cl/7482043

12 years agotesting: report test as failed if the test panics.
Ewan Chou [Mon, 1 Apr 2013 11:36:41 +0000 (22:36 +1100)]
testing: report test as failed if the test panics.

Fixes #5149.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/8136043

12 years agolib9/utf: Remove superfluous header inclusion.
Lucio De Re [Sun, 31 Mar 2013 19:28:22 +0000 (12:28 -0700)]
lib9/utf: Remove superfluous header inclusion.

<stdint.h> does not seem to be needed.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8178044

12 years agonet: update documentation for UnixConn, UnixListener and related stuff
Mikio Hara [Sun, 31 Mar 2013 07:48:18 +0000 (16:48 +0900)]
net: update documentation for UnixConn, UnixListener and related stuff

Closes the API documentation gap between platforms.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8063044

12 years agonet: update documentation for UDPConn and related stuff
Mikio Hara [Sun, 31 Mar 2013 07:47:54 +0000 (16:47 +0900)]
net: update documentation for UDPConn and related stuff

Closes the API documentation gap between platforms.
Also makes the code textual representation same between platforms.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8148043

12 years agonet: update documentation for TCPConn, TCPListener and related stuff
Mikio Hara [Sun, 31 Mar 2013 07:47:26 +0000 (16:47 +0900)]
net: update documentation for TCPConn, TCPListener and related stuff

Closes the API documentation gap between platforms.
Also makes the code textual representation same between platforms.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8147043

12 years agonet: update documentation for IPConn and related stuff
Mikio Hara [Sun, 31 Mar 2013 07:46:59 +0000 (16:46 +0900)]
net: update documentation for IPConn and related stuff

Closes the API documentation gap between platforms.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8143044

12 years agonet/http: Transport: be paranoid about any non-100 1xx response
Brad Fitzpatrick [Sun, 31 Mar 2013 05:59:08 +0000 (22:59 -0700)]
net/http: Transport: be paranoid about any non-100 1xx response

Since we can't properly handle anything except 100, treat all
1xx informational responses as sketchy and don't reuse the
connection for future requests.

The only other 1xx response code currently in use in the wild
is WebSockets' use of "101 Switching Protocols", but our
code.google.com/p/go.net/websockets doesn't use Client or
Transport: it uses ReadResponse directly, so is unaffected by
this CL.  (and its tests still pass)

So this CL is entirely just future-proofing paranoia.
Also: the Internet is weird.

Update #2184
Update #3665

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8208043

12 years agoruntime: TestGcSys: if GOGC=off, skip instead of failing
Albert Strasheim [Sat, 30 Mar 2013 22:10:53 +0000 (15:10 -0700)]
runtime: TestGcSys: if GOGC=off, skip instead of failing

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8201043

12 years agonet/http: fix incredibly racy TestTransportReading100Continue
Brad Fitzpatrick [Sat, 30 Mar 2013 18:18:56 +0000 (11:18 -0700)]
net/http: fix incredibly racy TestTransportReading100Continue

Whoops. I'm surprised it even worked before. (Need two pipes,
not one.)

Also, remove the whole pipe registration business, since it
wasn't even required in the previous version. (I'd later fixed
it at the end of send100Response, but forgot to delete it)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8191044

12 years agodoc/go1.1: mention (*testing.B).ReportAllocs()
Shenghou Ma [Sat, 30 Mar 2013 18:17:25 +0000 (02:17 +0800)]
doc/go1.1: mention (*testing.B).ReportAllocs()

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8198043

12 years agonet/textproto: report allocs in benchmarks
Brad Fitzpatrick [Sat, 30 Mar 2013 17:52:22 +0000 (10:52 -0700)]
net/textproto: report allocs in benchmarks

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/8187045

12 years agomisc/emacs: Enable compilation-mode for gofmt error buffer before displaying it.
Dominik Honnef [Sat, 30 Mar 2013 16:54:08 +0000 (09:54 -0700)]
misc/emacs: Enable compilation-mode for gofmt error buffer before displaying it.

Some packages, like popwin.el, change display behaviour based on
the buffer's mode, so we should enable compilation-mode before
displaying the buffer.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8155043

12 years agocmd/gc, cmd/ld: fix warnings on Plan 9
David du Colombier [Sat, 30 Mar 2013 16:44:52 +0000 (09:44 -0700)]
cmd/gc, cmd/ld: fix warnings on Plan 9

src/cmd/gc/closure.c:133 param declared and not used: nowrap
src/cmd/gc/const.c:1139 set and not used: t1
src/cmd/ld/data.c:652 format mismatch #llx INT, arg 7
src/cmd/ld/data.c:652 format mismatch #llx INT, arg 8
src/cmd/ld/data.c:1230 set and not used: datsize

R=dave, golang-dev, lucio.dere, remyoudompheng, bradfitz
CC=golang-dev
https://golang.org/cl/8182043

12 years agocmd/6g: fix warnings on Plan 9
David du Colombier [Sat, 30 Mar 2013 16:31:49 +0000 (09:31 -0700)]
cmd/6g: fix warnings on Plan 9

src/cmd/6g/peep.c:471 set and not used: r
src/cmd/6g/peep.c:560 overspecified class: regconsttyp GLOBL STATIC
src/cmd/6g/peep.c:761 more arguments than format IND STRUCT Prog
src/cmd/6g/reg.c:185 set and not used: r1
src/cmd/6g/reg.c:786 format mismatch d VLONG, arg 3
src/cmd/6g/reg.c:1064 format mismatch d VLONG, arg 5

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8197044

12 years agoos/exec, syscall: fix tests to pass when GOGCTRACE=1 is set
Albert Strasheim [Sat, 30 Mar 2013 16:22:11 +0000 (09:22 -0700)]
os/exec, syscall: fix tests to pass when GOGCTRACE=1 is set

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/8193043

12 years agoinclude/plan9/libc.h: fix Plan 9 build
David du Colombier [Sat, 30 Mar 2013 11:05:00 +0000 (19:05 +0800)]
include/plan9/libc.h: fix Plan 9 build

Add missing getgoextlinkenabled(void) declaration
in Plan 9 libc.h. This function was added as part
of CL #8183043.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/8191043

12 years agomisc/cgo/gmp: fix typo.
Andrey Mirtchovski [Sat, 30 Mar 2013 11:02:14 +0000 (19:02 +0800)]
misc/cgo/gmp: fix typo.

R=golang-dev, minux
CC=golang-dev
https://golang.org/cl/8174045

12 years agonet: avoid use of listener socket options on active open sockets
Mikio Hara [Sat, 30 Mar 2013 06:21:22 +0000 (15:21 +0900)]
net: avoid use of listener socket options on active open sockets

This CL ensures we use the correct socket options for
passive and active open sockets.

For the passive open sockets created by Listen functions,
additional SO_REUSEADDR, SO_REUSEPORT options are required
for the quick service restart and/or multicasting.

For the active open sockets created by Dial functions, no
additional options are required.

R=golang-dev, dave, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7795050

12 years agomisc/dashboard/codereview: add Rémy to the list of assignees
Dave Cheney [Sat, 30 Mar 2013 04:53:44 +0000 (15:53 +1100)]
misc/dashboard/codereview: add Rémy to the list of assignees

R=dsymonds, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/8094047

12 years agonet/http: ignore 100-continue responses in Transport
Brad Fitzpatrick [Sat, 30 Mar 2013 03:25:11 +0000 (20:25 -0700)]
net/http: ignore 100-continue responses in Transport

"There are only two hard problems in computer science:
cache invalidation, naming things, and off-by-one errors."

The HTTP server code already strips Expect: 100-continue on
requests, so httputil.ReverseProxy should be unaffected, but
some servers send unsolicited HTTP/1.1 100 Continue responses,
so we need to skip over them if they're seen to avoid getting
off-by-one on Transport requests/responses.

This does change the behavior of people who were using Client
or Transport directly and explicitly setting "Expect: 100-continue"
themselves, but it didn't work before anyway. Now instead of the
user code seeing a 100 response and then things blowing up, now
it basically works, except the Transport will still blast away
the full request body immediately.  That's the part that needs
to be finished to close this issue.

This is the safe quick fix.

Update #3665

R=golang-dev, dsymonds, dave, jgrahamc
CC=golang-dev
https://golang.org/cl/8166045

12 years agocmd/dist, cmd/ld: GO_EXTLINK_ENABLED=0 defaults to -linkmode=internal
Ian Lance Taylor [Fri, 29 Mar 2013 23:33:35 +0000 (16:33 -0700)]
cmd/dist, cmd/ld: GO_EXTLINK_ENABLED=0 defaults to -linkmode=internal

Change build system to set GO_EXTLINK_ENABLED=0 by default for
OS X 10.6, since the system linker has a bug and can not
handle the object files generated by 6l.

Fixes #5130.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8183043

12 years agobytes: Benchmark Buffer's compactions
Robert Obryk [Fri, 29 Mar 2013 21:17:09 +0000 (14:17 -0700)]
bytes: Benchmark Buffer's compactions

This benchmark verifies that CL #8173043 reduces time spent
sliding the Buffer's contents.

Results without and with CL #8173043 applied:
benchmark                        old ns/op    new ns/op    delta
BenchmarkBufferFullSmallReads       755336       175054  -76.82%

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8174043

12 years agoA+C: Robert Obryk (individual CLA)
Brad Fitzpatrick [Fri, 29 Mar 2013 21:16:41 +0000 (14:16 -0700)]
A+C: Robert Obryk (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/8176043

12 years agobytes: document that Buffer.Write grows the buffer
Rob Pike [Fri, 29 Mar 2013 21:09:31 +0000 (14:09 -0700)]
bytes: document that Buffer.Write grows the buffer
Do a little reformatting too.
Fixes #5152.

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/8157044

12 years agoruntime: additional map benchmarks for repeated lookups
Brad Fitzpatrick [Fri, 29 Mar 2013 20:50:44 +0000 (13:50 -0700)]
runtime: additional map benchmarks for repeated lookups

For the future.

Update #5147

R=khr, r
CC=golang-dev
https://golang.org/cl/8165044

12 years agobytes: don't compact Buffer so aggressively
Brad Fitzpatrick [Fri, 29 Mar 2013 20:49:14 +0000 (13:49 -0700)]
bytes: don't compact Buffer so aggressively

benchmark                           old ns/op    new ns/op    delta
BenchmarkBufferNotEmptyWriteRead       848416       819983   -3.35%

Update #5154

R=golang-dev, gri, robryk
CC=golang-dev
https://golang.org/cl/8173043

12 years agobytes: don't grow Buffer if capacity is available
Brad Fitzpatrick [Fri, 29 Mar 2013 19:39:19 +0000 (12:39 -0700)]
bytes: don't grow Buffer if capacity is available

Also added a new benchmark from the same test:

benchmark                           old ns/op    new ns/op    delta
BenchmarkBufferNotEmptyWriteRead      2643698       709189  -73.17%

Fixes #5154

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/8164043

12 years agoruntime: fix gdb printing of maps
Keith Randall [Fri, 29 Mar 2013 18:04:07 +0000 (11:04 -0700)]
runtime: fix gdb printing of maps
Fixes #5098

R=minux.ma, bradfitz, khr, rsc
CC=golang-dev
https://golang.org/cl/7746045

12 years agodoc: fix typo in effective_go.html
Elias Naur [Fri, 29 Mar 2013 17:28:37 +0000 (10:28 -0700)]
doc: fix typo in effective_go.html

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7548045

12 years agonet/http: ignore more uninteresting goroutines
Brad Fitzpatrick [Fri, 29 Mar 2013 15:30:28 +0000 (08:30 -0700)]
net/http: ignore more uninteresting goroutines

These only show up if GOTRACEBACK=2

Update #5005

R=golang-dev, fullung
CC=golang-dev
https://golang.org/cl/8156044

12 years ago8a/8l: add PCMPEQB and PMOVMSKB to 386.
Keith Randall [Fri, 29 Mar 2013 07:34:03 +0000 (00:34 -0700)]
8a/8l: add PCMPEQB and PMOVMSKB to 386.

Used by CL 8056043 for fast string equals.

R=bradfitz
CC=golang-dev
https://golang.org/cl/8102044

12 years agoapi: remove Zone of net.IPNet from next.txt
Mikio Hara [Fri, 29 Mar 2013 06:07:38 +0000 (15:07 +0900)]
api: remove Zone of net.IPNet from next.txt

Update #4234.
Update #4501.

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/8129043

12 years agonet: close TCPListener in example
Mikio Hara [Fri, 29 Mar 2013 06:07:10 +0000 (15:07 +0900)]
net: close TCPListener in example

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8073044

12 years agonet: update documentation for ListenTCP, ListenUDP
Mikio Hara [Fri, 29 Mar 2013 06:06:43 +0000 (15:06 +0900)]
net: update documentation for ListenTCP, ListenUDP

Adds the missing wildcard port assignment description to ListenUDP.
Also updates the wildcard port description on ListenTCP.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/8063043

12 years agonet: update documentation for FileConn, FilePacketConn, FileListener
Mikio Hara [Fri, 29 Mar 2013 03:16:24 +0000 (12:16 +0900)]
net: update documentation for FileConn, FilePacketConn, FileListener

Closes the API documentation gap between platforms.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8086043

12 years agonet: enable IPv6 tests on Windows
Mikio Hara [Fri, 29 Mar 2013 02:46:47 +0000 (11:46 +0900)]
net: enable IPv6 tests on Windows

Also removes redundant tests that run Go 1.0 non-IPv6 support
Windows code on IPv6 enabled Windows kernels.

R=alex.brainman, golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7812052

12 years agonet/http: unflake TestTransportConcurrency
Brad Fitzpatrick [Fri, 29 Mar 2013 01:36:06 +0000 (18:36 -0700)]
net/http: unflake TestTransportConcurrency

Fixes #5005

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8127043

12 years agogo/printer: use strings.Split instead of specialized code
Robert Griesemer [Thu, 28 Mar 2013 22:47:39 +0000 (15:47 -0700)]
go/printer: use strings.Split instead of specialized code

With the faster strings package, the difference between
the specialized code and strings.Split is in the noise:

benchmark         old ns/op    new ns/op    delta
BenchmarkPrint     16724291     16686729   -0.22%

(Measured on a Mac Pro, 2.8GHz Quad-core Intel Xeon,
4GB 800 MHz DDR2, Mac OS X 10.8.3)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8100044

12 years agocmd/ld: only pass -rdynamic to host linker on ELF target
Ian Lance Taylor [Thu, 28 Mar 2013 22:04:25 +0000 (15:04 -0700)]
cmd/ld: only pass -rdynamic to host linker on ELF target

Fixes #5150.

R=golang-dev, franciscossouza
CC=golang-dev
https://golang.org/cl/8120043

12 years agonet/http: reuse textproto.Readers; remove 2 more allocations
Brad Fitzpatrick [Thu, 28 Mar 2013 21:51:21 +0000 (14:51 -0700)]
net/http: reuse textproto.Readers; remove 2 more allocations

Saves both the textproto.Reader allocation, and its internal
scratch buffer growing.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10324        10149   -1.70%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           19           17  -10.53%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1559         1492   -4.30%

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/8094046

12 years agocmd/godoc: provide a link from notes to source location
Robert Griesemer [Thu, 28 Mar 2013 21:40:59 +0000 (14:40 -0700)]
cmd/godoc: provide a link from notes to source location

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8122043

12 years agocmd/ld, runtime: restrict stack root scan to locals and arguments
Carl Shapiro [Thu, 28 Mar 2013 21:36:23 +0000 (14:36 -0700)]
cmd/ld, runtime: restrict stack root scan to locals and arguments

Updates #5134

R=golang-dev, bradfitz, cshapiro, daniel.morsing, ality, iant
CC=golang-dev
https://golang.org/cl/8022044

12 years agonet/http: parse Request-Line in a function, remove an allocation
Brad Fitzpatrick [Thu, 28 Mar 2013 21:19:51 +0000 (14:19 -0700)]
net/http: parse Request-Line in a function, remove an allocation

Removes another per-request allocation. Also makes the code more
readable, IMO. And more testable.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10539        10324   -2.04%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           20           19   -5.00%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1609         1559   -3.11%

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8118044

12 years agonet/url: use strings.Index instead of a loop
Brad Fitzpatrick [Thu, 28 Mar 2013 20:43:34 +0000 (13:43 -0700)]
net/url: use strings.Index instead of a loop

We already depend on strings in this file, so use it.

Plus strings.Index will be faster than a manual loop
once issue 3751 is finished.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/8116043

12 years agogo/doc: fix typo in comment
Robert Griesemer [Thu, 28 Mar 2013 20:13:55 +0000 (13:13 -0700)]
go/doc: fix typo in comment

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8113043

12 years agonet/http: inline chunkWriter in response
Brad Fitzpatrick [Thu, 28 Mar 2013 20:13:28 +0000 (13:13 -0700)]
net/http: inline chunkWriter in response

A chunkWriter and a response are 1:1. Make them contiguous in
memory and save an allocation.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10715        10539   -1.64%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           21           20   -4.76%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1626         1609   -1.05%

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8114043

12 years agonet/http: remove two more server allocations per-request
Brad Fitzpatrick [Thu, 28 Mar 2013 20:07:14 +0000 (13:07 -0700)]
net/http: remove two more server allocations per-request

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        11031        10689   -3.10%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           23           21   -8.70%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1668         1626   -2.52%

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8110044

12 years agocmd/godoc: cleanups
Robert Griesemer [Thu, 28 Mar 2013 20:05:30 +0000 (13:05 -0700)]
cmd/godoc: cleanups

- removed gratuitous empty lines that creeped into command line output
- changed comment color to a dark green so that links don't visually melt into them
- removed some TODOs
- updated doc.go

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8108044

12 years agonet/http: more tests, better comments, remove an allocation
Brad Fitzpatrick [Thu, 28 Mar 2013 18:35:24 +0000 (11:35 -0700)]
net/http: more tests, better comments, remove an allocation

Add more tests around the various orders handlers can access
and flush response headers.

Also clarify the documentation on fields of response and
chunkWriter.

While there, remove an allocation (a header clone) for simple
handlers.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        15245        14966   -1.83%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           24           23   -4.17%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1717         1668   -2.85%

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8101043

12 years agocmd/ld: when using host linker pass -r option as -rpath
Ian Lance Taylor [Thu, 28 Mar 2013 16:37:32 +0000 (09:37 -0700)]
cmd/ld: when using host linker pass -r option as -rpath

R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/8070043

12 years agocmd/godoc: don't crash if there's no documentation
Robert Griesemer [Thu, 28 Mar 2013 15:46:17 +0000 (08:46 -0700)]
cmd/godoc: don't crash if there's no documentation

Fixes regression introduced by CL 7860049.

R=golang-dev, kamil.kisiel, dave
CC=golang-dev
https://golang.org/cl/8069044

12 years agovet: add a progress message to asmdecl.go
Rob Pike [Wed, 27 Mar 2013 23:55:16 +0000 (16:55 -0700)]
vet: add a progress message to asmdecl.go
Analogous to the one for .go files, it's for .s only and is protected
by the verbose flag.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8030046

12 years agotext/template: fix bug in evaluating a chain starting with a function.
Rob Pike [Wed, 27 Mar 2013 23:31:14 +0000 (16:31 -0700)]
text/template: fix bug in evaluating a chain starting with a function.

R=golang-dev, alberto.garcia.hierro
CC=golang-dev
https://golang.org/cl/7861046

12 years agovet: fix test_deadcode.go's tests
Rob Pike [Wed, 27 Mar 2013 23:30:20 +0000 (16:30 -0700)]
vet: fix test_deadcode.go's tests
This is a totally mechanical change.
Errors are reported for the beginning of the statement, not the end,
so the errchk markers need to be on the opening brace, not the closing
one. It seems this test was never run.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7746050

12 years agocmd/vet: fix assembly test files
Rob Pike [Wed, 27 Mar 2013 23:29:12 +0000 (16:29 -0700)]
cmd/vet: fix assembly test files
They should be build-tagged for vet_test not ignore,
and not have a Go package clause.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8016047

12 years agoruntime: allocate maps' first bucket table lazily
Brad Fitzpatrick [Wed, 27 Mar 2013 23:28:51 +0000 (16:28 -0700)]
runtime: allocate maps' first bucket table lazily

Motivated by garbage profiling in HTTP benchmarks. This
changes means new empty maps are just one small allocation
(the HMap) instead the HMap + the relatively larger h->buckets
allocation. This helps maps which remain empty throughout
their life.

benchmark               old ns/op    new ns/op    delta
BenchmarkNewEmptyMap          196          107  -45.41%

benchmark              old allocs   new allocs    delta
BenchmarkNewEmptyMap            2            1  -50.00%

benchmark               old bytes    new bytes    delta
BenchmarkNewEmptyMap          195           50  -74.36%

R=khr, golang-dev, r
CC=golang-dev
https://golang.org/cl/7722046

12 years agocmd/ld: fix OpenBSD (third try)
Ian Lance Taylor [Wed, 27 Mar 2013 23:00:58 +0000 (16:00 -0700)]
cmd/ld: fix OpenBSD (third try)

On OpenBSD don't mark runtime.{g,m} as STT_TLS symbols.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7867046

12 years agofaq: update with some links and 1.1-specific details
Rob Pike [Wed, 27 Mar 2013 22:26:57 +0000 (15:26 -0700)]
faq: update with some links and 1.1-specific details

R=golang-dev, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/8038048

12 years agocmd/godoc: emit id's for constants and variables
Robert Griesemer [Wed, 27 Mar 2013 22:14:28 +0000 (15:14 -0700)]
cmd/godoc: emit id's for constants and variables

Fixes #5077.

R=r
CC=golang-dev
https://golang.org/cl/8021044

12 years agocmd/ld, cmd/8l: Fix OpenBSD build.
Ian Lance Taylor [Wed, 27 Mar 2013 22:00:11 +0000 (15:00 -0700)]
cmd/ld, cmd/8l: Fix OpenBSD build.

Don't generate TLS sections on OpenBSD.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8059043

12 years agocmd/6l: fix OpenBSD build
Ian Lance Taylor [Wed, 27 Mar 2013 21:32:51 +0000 (14:32 -0700)]
cmd/6l: fix OpenBSD build

Avoid generating TLS relocations on OpenBSD.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7641055

12 years agocmd/gc: update runtime.go for new map implementation.
Rémy Oudompheng [Wed, 27 Mar 2013 20:51:07 +0000 (21:51 +0100)]
cmd/gc: update runtime.go for new map implementation.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8051044

12 years agonet/http: server optimization; reduce GCs, generate ~half the garbage
Brad Fitzpatrick [Wed, 27 Mar 2013 20:35:49 +0000 (13:35 -0700)]
net/http: server optimization; reduce GCs, generate ~half the garbage

There was another bufio.Writer not being reused, found with
GOGC=off and -test.memprofile.

benchmark                               old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAlive        18270        16046  -12.17%

benchmark                              old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAlive           38           36   -5.26%

benchmark                               old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAlive         4598         2488  -45.89%

Update #5100

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8038047

12 years agonet/http: new server-only, single-connection keep-alive benchmark
Brad Fitzpatrick [Wed, 27 Mar 2013 20:35:41 +0000 (13:35 -0700)]
net/http: new server-only, single-connection keep-alive benchmark

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8046043

12 years agocmd/ld: emit TLS relocations during external linking
Ian Lance Taylor [Wed, 27 Mar 2013 20:27:35 +0000 (13:27 -0700)]
cmd/ld: emit TLS relocations during external linking

This CL was written by rsc.  I just tweaked 8l.

This CL adds TLS relocation to the ELF .o file we write during external linking,
so that the host linker (gcc) can decide the final location of m and g.

Similar relocations are not necessary on OS X because we use an alternate
program start-time mechanism to acquire thread-local storage.

Similar relocations are not necessary on ARM or Plan 9 or Windows
because external linking mode is not yet supported on those systems.

On almost all ELF systems, the references we use are like %fs:-0x4 or %gs:-0x4,
which we write in 6a/8a as -0x4(FS) or -0x4(GS). On Linux/ELF, however,
Xen's lack of support for this mode forced us long ago to use a two-instruction
sequence: first we load %gs:0x0 into a register r, and then we use -0x4(r).
(The ELF program loader arranges that %gs:0x0 contains a regular pointer to
that same memory location.) In order to relocate those -0x4(r) references,
the linker must know where they are. This CL adds the equivalent notation
-0x4(r)(GS*1) for this purpose: it assembles to the same encoding as -0x4(r)
but the (GS*1) indicates to the linker that this is one of those thread-local
references that needs relocation.

Thanks to Elias Naur for reminding me about this missing piece and
also for writing the test.

R=r
CC=golang-dev
https://golang.org/cl/7891047

12 years agoruntime/race: mark failing test as such.
Rémy Oudompheng [Wed, 27 Mar 2013 20:15:05 +0000 (21:15 +0100)]
runtime/race: mark failing test as such.

Fixes race builder.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8055045

12 years agocmd/gc: fix race instrumentation of append and type switches.
Rémy Oudompheng [Wed, 27 Mar 2013 19:33:17 +0000 (20:33 +0100)]
cmd/gc: fix race instrumentation of append and type switches.

The remaining issues are about runtime and sync package
instrumentation.

Update #4228

R=dvyukov, bradfitz
CC=golang-dev
https://golang.org/cl/8041043

12 years agodoc: fix go1.1.html typos
Jonathan Rudenberg [Wed, 27 Mar 2013 18:09:14 +0000 (11:09 -0700)]
doc: fix go1.1.html typos

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7635049

12 years agonet/http: improve test leak checker flakiness
Brad Fitzpatrick [Wed, 27 Mar 2013 17:07:22 +0000 (10:07 -0700)]
net/http: improve test leak checker flakiness

And make it have more useful output on failure.

Update #5005

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8016046

12 years agolibmach: respect symbol table boundaries
Anthony Martin [Wed, 27 Mar 2013 12:59:06 +0000 (05:59 -0700)]
libmach: respect symbol table boundaries

Since fp->symsz includes the size of the header
in the new symbol table format, we were reading
past the end and decoding a few garbage symbols
from data in the pc/line table.

R=rsc, r
CC=golang-dev
https://golang.org/cl/7993043

12 years agonet/textproto: add "Cookie" to the common headers list
Brad Fitzpatrick [Wed, 27 Mar 2013 06:08:08 +0000 (23:08 -0700)]
net/textproto: add "Cookie" to the common headers list

Seems to have been omitted before.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7749049

12 years agogodoc: pass *PageInfos instead of *token.FileSets in templates
Robert Griesemer [Wed, 27 Mar 2013 01:28:16 +0000 (18:28 -0700)]
godoc: pass *PageInfos instead of *token.FileSets in templates

- convert all formatters that require a *token.FileSet to
  consistenly use a *PageInfo as first argument instead
- adjust templates correspondingly
- fix outstanding bug from previous CL 8005044

Going forward, with this change the affected functions have
access to the full page "context" (PageInfo), not just the
respective file set. This will permit better context-dependent
formatting in the future.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7860049

12 years agolib/codereview/codereview.py: fix crash when hg gofmt has no files
Rob Pike [Wed, 27 Mar 2013 00:32:22 +0000 (17:32 -0700)]
lib/codereview/codereview.py: fix crash when hg gofmt has no files
The gofmt function was returning a string, which isn't the right type.
Three cheers for dynamic typing.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7917044

12 years agocmd/gc: enable racewalk of HMUL nodes.
Rémy Oudompheng [Tue, 26 Mar 2013 22:35:42 +0000 (23:35 +0100)]
cmd/gc: enable racewalk of HMUL nodes.

A HMUL node appears in some constant divisions, but
to observe a false negative in race detector the divisor must be
suitably chosen to make sure the only memory access is
done for HMUL.

R=dvyukov
CC=golang-dev
https://golang.org/cl/7935045

12 years agodoc: consistent path names in example
Dave Cheney [Tue, 26 Mar 2013 22:22:23 +0000 (09:22 +1100)]
doc: consistent path names in example

Always use /home/you for $HOME in examples.

Trivial enough that someone else can integrate this change if they are editing go1.1.html

R=r
CC=golang-dev
https://golang.org/cl/8025043

12 years agopkg/runtime: ignore runtime.memlimit when allocating heap
Ian Lance Taylor [Tue, 26 Mar 2013 21:01:12 +0000 (14:01 -0700)]
pkg/runtime: ignore runtime.memlimit when allocating heap

For Go 1.1, stop checking the rlimit, because it broke now
that mheap is allocated using SysAlloc.  See issue 5049.

R=r
CC=golang-dev
https://golang.org/cl/7741050

12 years agogodoc: internal cleanup: remove a TODO
Robert Griesemer [Tue, 26 Mar 2013 20:12:38 +0000 (13:12 -0700)]
godoc: internal cleanup: remove a TODO

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8005044

12 years agoreflect: add garbage collection info in ChanOf, MapOf, PtrTo, SliceOf
Russ Cox [Tue, 26 Mar 2013 18:50:29 +0000 (11:50 -0700)]
reflect: add garbage collection info in ChanOf, MapOf, PtrTo, SliceOf

ArrayOf will remain unexported (and therefore unused) for Go 1.1.

Fixes #4375.

R=0xe2.0x9a.0x9b, r, iant
CC=golang-dev
https://golang.org/cl/7716048

12 years agodoc/go1.1.html: net/mail, net/smtp
Rob Pike [Tue, 26 Mar 2013 18:47:27 +0000 (11:47 -0700)]
doc/go1.1.html: net/mail, net/smtp

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7835049

12 years agoruntime: ensure forward progress when unwinding an arm stack frame
Carl Shapiro [Tue, 26 Mar 2013 18:43:09 +0000 (11:43 -0700)]
runtime: ensure forward progress when unwinding an arm stack frame

The arm gentraceback mishandled frame linkage values pointing
to the assembly return function.  This function is special as
its frame size is zero and it contains only one instruction.
These conditions would preserve the frame pointer and result
in an off by one error when unwinding the caller.

Fixes #5124

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8023043

12 years agogodoc: link identifiers to declarations
Robert Griesemer [Tue, 26 Mar 2013 18:14:30 +0000 (11:14 -0700)]
godoc: link identifiers to declarations

The changes are almost completely self-contained
in the new file linkify.go. The other changes are
minimal and should not disturb the currently
working godoc, in anticipation of Go 1.1.

To disable the feature in case of problems, set
-links=false.

Fixes #2063.

R=adg, r
CC=golang-dev
https://golang.org/cl/7883044

12 years agobuiltin: add linkable-to declarations for iota and nil
Rob Pike [Tue, 26 Mar 2013 18:05:06 +0000 (11:05 -0700)]
builtin: add linkable-to declarations for iota and nil
Aids godoc.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/7992044

12 years agodoc/go1.1.html: describe Zone and other net changes
Rob Pike [Tue, 26 Mar 2013 17:54:55 +0000 (10:54 -0700)]
doc/go1.1.html: describe Zone and other net changes
Mild adaptation of rsc's 8021043, which I was unable to clpatch.
(rsc is offline)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7741049

12 years agodoc: fix typo in go 1.1 doc
Andrew Gerrand [Tue, 26 Mar 2013 16:37:17 +0000 (09:37 -0700)]
doc: fix typo in go 1.1 doc

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7725049

12 years agoruntime: does not report duplicate errors in netpoll
Dmitriy Vyukov [Tue, 26 Mar 2013 16:25:43 +0000 (20:25 +0400)]
runtime: does not report duplicate errors in netpoll
Prevents storm of error messages if something goes wrong.
In the case of issue 5073 the epoll fd was closed by the test.
Update #5073.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/7966043

12 years agonet: fix test data corruption in repetitive test runs by -cpu
Mikio Hara [Tue, 26 Mar 2013 16:06:48 +0000 (01:06 +0900)]
net: fix test data corruption in repetitive test runs by -cpu

This CL avoids test data sharing in repetitive test runs;
e.g., go test net -cpu=1,1,1

R=golang-dev, fullung, bradfitz
CC=golang-dev
https://golang.org/cl/8011043

12 years agocmd/gc: more race instrumentation.
Rémy Oudompheng [Tue, 26 Mar 2013 07:27:18 +0000 (08:27 +0100)]
cmd/gc: more race instrumentation.

Handle interface comparison correctly,
add a few more tests, mark more nodes as impossible.

R=dvyukov, golang-dev
CC=golang-dev
https://golang.org/cl/7942045

12 years agocmd/gc: fix nil pointer dereferences.
Rémy Oudompheng [Tue, 26 Mar 2013 07:20:10 +0000 (08:20 +0100)]
cmd/gc: fix nil pointer dereferences.

Fixes #5119.

R=golang-dev, dvyukov, dave, rsc
CC=golang-dev
https://golang.org/cl/7838050

12 years agomisc/vim: make Godoc command work with "log.Print".
Yasuhiro Matsumoto [Tue, 26 Mar 2013 06:39:46 +0000 (17:39 +1100)]
misc/vim: make Godoc command work with "log.Print".

R=dsymonds
CC=golang-dev
https://golang.org/cl/7757043

12 years agoimage/gif: make test repeatable
Dave Cheney [Tue, 26 Mar 2013 05:20:17 +0000 (16:20 +1100)]
image/gif: make test repeatable

Fixes issue with go test -cpu=1,1

R=minux.ma, bradfitz, nigeltao
CC=golang-dev
https://golang.org/cl/7808045

12 years agodoc/articles: update reference to obsolete "package documentation".
David Symonds [Tue, 26 Mar 2013 02:01:24 +0000 (13:01 +1100)]
doc/articles: update reference to obsolete "package documentation".

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7475048

12 years agodatabase/sql: optimized []byte copy + []byte(nil) -> *interface fix
Julien Schmidt [Tue, 26 Mar 2013 00:43:30 +0000 (17:43 -0700)]
database/sql: optimized []byte copy + []byte(nil) -> *interface fix

Make the copy directly in the convert switch instead of an extra loop.
Also stops converting nil-[]byte to zero-[]byte when assigning to *interface

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7962044

12 years agodoc/go1.1.html: introduction
Rob Pike [Tue, 26 Mar 2013 00:41:12 +0000 (17:41 -0700)]
doc/go1.1.html: introduction

R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/7696045

12 years agodatabase/sql: link to driver wiki page
Brad Fitzpatrick [Tue, 26 Mar 2013 00:38:51 +0000 (17:38 -0700)]
database/sql: link to driver wiki page

Fixes #5127

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8011044

12 years agodatabase/sql: don't close a driver.Conn until its Stmts are closed
Brad Fitzpatrick [Mon, 25 Mar 2013 23:50:27 +0000 (16:50 -0700)]
database/sql: don't close a driver.Conn until its Stmts are closed

Fixes #5046

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8016044

12 years agocrypto/rsa: don't correct private exponent unless needed.
Adam Langley [Mon, 25 Mar 2013 23:08:29 +0000 (19:08 -0400)]
crypto/rsa: don't correct private exponent unless needed.

At some point in the past, I believe the GCD algorithm was setting d to
be negative. The RSA code has been correcting that ever since but, now,
it appears to have changed and the correction isn't needed.

Having d be too large is harmless, it's just a little odd and I
happened to notice.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7948044