]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agocmd/gc: fix method values whose receiver is an unnamed interface.
Rémy Oudompheng [Thu, 29 Aug 2013 08:00:58 +0000 (10:00 +0200)]
cmd/gc: fix method values whose receiver is an unnamed interface.

Fixes #6140.

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

11 years agocmd/go: make it work for code.google.com cloned repositories
Rob Pike [Thu, 29 Aug 2013 07:15:35 +0000 (17:15 +1000)]
cmd/go: make it work for code.google.com cloned repositories

Thanks to beatgammit for the fix.

Fixes #5408.

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

11 years agonet: make channel-based semaphore depend on receive, not send
Robert Daniel Kortschak [Thu, 29 Aug 2013 07:14:57 +0000 (17:14 +1000)]
net: make channel-based semaphore depend on receive, not send

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

11 years agoundo CL 13180043 / 318540e7857f
Andrew Gerrand [Thu, 29 Aug 2013 04:45:59 +0000 (14:45 +1000)]
undo CL 13180043 / 318540e7857f

Accidentally submitted.

««« original CL description
encoding/json: add "overflow" struct tag option

Fixes #6213.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/13180043
»»»

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

11 years agoos/exec: return idempotent Closer from StdinPipe
Andrew Gerrand [Thu, 29 Aug 2013 04:41:44 +0000 (14:41 +1000)]
os/exec: return idempotent Closer from StdinPipe

Before this fix, it was always an error to use the Close method on the
io.WriteCloser obtained from Cmd.StdinPipe, as it would race with the
Close performed by Cmd.Wait.

Fixes #6270.

R=golang-dev, r, remyoudompheng, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/13329043

11 years agoencoding/json: add "overflow" struct tag option
Andrew Gerrand [Thu, 29 Aug 2013 04:39:55 +0000 (14:39 +1000)]
encoding/json: add "overflow" struct tag option

Fixes #6213.

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

11 years agosort: use a very fast random generator for benchmarks
Dave Cheney [Thu, 29 Aug 2013 03:21:21 +0000 (13:21 +1000)]
sort: use a very fast random generator for benchmarks

Adapted from https://golang.org/cl/11564044.

Fixes breakage of darwin-amd64-race builder.

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

11 years agoruntime: re-enable TestParForParallel
Rob Pike [Thu, 29 Aug 2013 01:42:18 +0000 (11:42 +1000)]
runtime: re-enable TestParForParallel

See how it flies. We'll disable it again if the underlying issue is not resolved.
See issue 4155 for details.

Fixes #4155.

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

11 years agonet: make protocol-specific Dial and Listen return consistent error value
Mikio Hara [Wed, 28 Aug 2013 10:51:02 +0000 (19:51 +0900)]
net: make protocol-specific Dial and Listen return consistent error value

Update #4856

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

11 years agonet: BUG section for ReadFrom, ReadFromIP methods of IPConn on "ip4" network
Mikio Hara [Wed, 28 Aug 2013 10:49:17 +0000 (19:49 +0900)]
net: BUG section for ReadFrom, ReadFromIP methods of IPConn on "ip4" network

Fixes #3944.

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

11 years agocmd/go: add -race flag to 'go list'
Rob Pike [Thu, 29 Aug 2013 01:16:53 +0000 (11:16 +1000)]
cmd/go: add -race flag to 'go list'

Causes the package dependencies to include those for race detection.
Fixes #5653.

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

11 years agodoc/go1.2.txt: text/template's if-else
Rob Pike [Thu, 29 Aug 2013 00:09:23 +0000 (10:09 +1000)]
doc/go1.2.txt: text/template's if-else

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

11 years agofmt: Remove some unnecessary conversions.
Robin Eklind [Wed, 28 Aug 2013 18:55:39 +0000 (11:55 -0700)]
fmt: Remove some unnecessary conversions.

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

11 years agotime: add more docs on Sleep
Brad Fitzpatrick [Wed, 28 Aug 2013 18:16:55 +0000 (11:16 -0700)]
time: add more docs on Sleep

Merge the comment from runtime/time.goc ("at least")
and also note that negative is okay and won't crash.
I see people going out of their way to avoid passing
a negative value to Sleep.

R=golang-dev, adg, r, alex.brainman
CC=golang-dev
https://golang.org/cl/13271045

11 years agotext/template: allow {{else if ... }} to simplify if chains
Rob Pike [Wed, 28 Aug 2013 04:43:56 +0000 (14:43 +1000)]
text/template: allow {{else if ... }} to simplify if chains
The method is simple: the parser just parses

        {{if A}}a{{else if B}}b{{end}}

to the same tree that would be produced by

        {{if A}}a{{else}}{{if B}}b{{end}}{{end}}

Thus no changes are required in text/template itself
or in html/template, only in text/template/parse.

Fixes #6085

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

11 years agosync: improve once.Do documentation readability
Josh Bleecher Snyder [Wed, 28 Aug 2013 02:53:59 +0000 (12:53 +1000)]
sync: improve once.Do documentation readability

The previous wording, though accurate, was hard to parse.
In particular, it was tempting to interpret "the method"
as referring to "the function f" instead of "Do", and
required effort to find the correct antecedent for
"this receiver".

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

11 years agoC: add Asim Shankar (Google CLA)
Andrew Gerrand [Tue, 27 Aug 2013 23:40:08 +0000 (09:40 +1000)]
C: add Asim Shankar (Google CLA)

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

11 years agonet/http: document Request.Body more
Brad Fitzpatrick [Tue, 27 Aug 2013 23:13:21 +0000 (16:13 -0700)]
net/http: document Request.Body more

Fixes #6221

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

11 years agonet/smtp: clarify that SendMail's auth param is optional
Brad Fitzpatrick [Tue, 27 Aug 2013 23:12:11 +0000 (16:12 -0700)]
net/smtp: clarify that SendMail's auth param is optional

It wasn't obvious that the Auth could be nil.

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

11 years agocmd/gc: tag builtin error, byte, rune to avoid exporting them.
Rémy Oudompheng [Tue, 27 Aug 2013 19:18:32 +0000 (21:18 +0200)]
cmd/gc: tag builtin error, byte, rune to avoid exporting them.

Fixes #5910.
Fixes #6260.

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

11 years agocmd/5g: avoid clash between R13 and F3 registers.
Rémy Oudompheng [Tue, 27 Aug 2013 19:09:16 +0000 (21:09 +0200)]
cmd/5g: avoid clash between R13 and F3 registers.

Fixes #6247.

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

11 years agomisc/pprof: pprof http used with net/http/pprof not working on windows/amd64
Shivakumar GN [Tue, 27 Aug 2013 17:35:06 +0000 (10:35 -0700)]
misc/pprof: pprof http used with net/http/pprof not working on windows/amd64

Removed posix assumptions in temporary file generation
Removed curl dependence
Changed opening of svg file

These must now work including symbol resolution.
[1] go tool pprof <prog_name> http://.../debug/pprof/profile
[2] go tool pprof http://.../debug/pprof/profile

Fixes 6177.

R=golang-dev, alex.brainman, bradfitz, kamil.kisiel
CC=golang-dev
https://golang.org/cl/13085043

11 years agogo/ast: fix comment formatting
Caleb Spare [Tue, 27 Aug 2013 16:03:38 +0000 (09:03 -0700)]
go/ast: fix comment formatting

A bullet list was getting mangled in godoc.

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

11 years agosort: harden limit in stable test
Volker Dobler [Tue, 27 Aug 2013 15:41:43 +0000 (08:41 -0700)]
sort: harden limit in stable test

Reduce the number of allowed swap operations during stable sort. 

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

11 years agomisc/emacs: allow users to customize path of 'go' tool.
Alan Donovan [Tue, 27 Aug 2013 13:47:58 +0000 (09:47 -0400)]
misc/emacs: allow users to customize path of 'go' tool.

Some users have multiple Go development trees and invoke the
'go' tool via a wrapper that sets GOROOT and GOPATH based on
the current directory.  Such users should customize go-command
to point to the wrapper script.

R=dominik.honnef
CC=golang-dev
https://golang.org/cl/13233043

11 years agocmd/gc: mark panicslice as unlikely
Volker Dobler [Tue, 27 Aug 2013 13:38:11 +0000 (06:38 -0700)]
cmd/gc: mark panicslice as unlikely

No measurable impact on performance on amd64

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

11 years agoencoding/binary: use bytes.Reader in read example
Mathieu Lonjaret [Tue, 27 Aug 2013 13:32:24 +0000 (06:32 -0700)]
encoding/binary: use bytes.Reader in read example

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

11 years agonet: have separate read and write processing threads on windows
Alex Brainman [Tue, 27 Aug 2013 04:53:57 +0000 (14:53 +1000)]
net: have separate read and write processing threads on windows

Fixes #4195

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

11 years agodoc/go1.2.txt: dereference pointer values when evaluating args for escape funcs
Rob Pike [Tue, 27 Aug 2013 04:33:05 +0000 (14:33 +1000)]
doc/go1.2.txt: dereference pointer values when evaluating args for escape funcs

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

11 years agotext/template: make the escapers for HTML etc. handle pointers correctly
Rob Pike [Tue, 27 Aug 2013 03:29:07 +0000 (13:29 +1000)]
text/template: make the escapers for HTML etc. handle pointers correctly
Apply the same rules for argument evaluation and indirection that are
used by the regular evaluator.

Fixes #5802

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

11 years agonet: enable PacketConn test for raw IP network on Windows
Mikio Hara [Mon, 26 Aug 2013 09:36:58 +0000 (18:36 +0900)]
net: enable PacketConn test for raw IP network on Windows

Just forgot to include this in CL 12843043.
Also consolidates the code dealing with test environment.

Update #6122

R=alex.brainman
CC=golang-dev
https://golang.org/cl/13184043

11 years agobytes, strings: use copy in Repeat
Evan Shaw [Mon, 26 Aug 2013 23:21:08 +0000 (09:21 +1000)]
bytes, strings: use copy in Repeat

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

11 years agoC: add JP Sugarbroad (Google CLA)
Adam Langley [Mon, 26 Aug 2013 23:11:43 +0000 (19:11 -0400)]
C: add JP Sugarbroad (Google CLA)

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

11 years agonet/http: do not send leading dot in cookie domain attribute
Volker Dobler [Mon, 26 Aug 2013 12:41:37 +0000 (07:41 -0500)]
net/http: do not send leading dot in cookie domain attribute

RFC 6265 allows a leading dot in a cookie domain attribute
but is clear (see section 4.1.1) that a Set-Cookie header
should be sent without these dots.

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

11 years agodoc/go_faq.html: fix non-grammatical sentence
Rob Pike [Sun, 25 Aug 2013 13:50:44 +0000 (23:50 +1000)]
doc/go_faq.html: fix non-grammatical sentence
With my apologies.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12984045

11 years agosyscall: update routing socket parser for NetBSD 6 and beyond
Mikio Hara [Sat, 24 Aug 2013 23:44:31 +0000 (08:44 +0900)]
syscall: update routing socket parser for NetBSD 6 and beyond

NetBSD 6 kernel and beyond require 64-bit aligned access to routing
facilities.

Fixes #6226.

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

11 years agobytes: clarify Equal docs
Brad Fitzpatrick [Sat, 24 Aug 2013 22:05:27 +0000 (17:05 -0500)]
bytes: clarify Equal docs

== isn't defined on slices, so don't use it in docs.

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

11 years agocmd/api: be more robust against OS deleting temp files
Brad Fitzpatrick [Sat, 24 Aug 2013 21:54:56 +0000 (16:54 -0500)]
cmd/api: be more robust against OS deleting temp files

OS X in particular deletes tmp files (but not directories)
pretty reliably.

Ask hg whether the go.tools directory in tmp is good before
using it.

Fixes issue Rob and others were reporting, which I just hit
myself now.

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

11 years agocmd/api: ignore GOARCH when building cmd/api.
Brad Fitzpatrick [Sat, 24 Aug 2013 14:51:42 +0000 (09:51 -0500)]
cmd/api: ignore GOARCH when building cmd/api.

This was breaking people setting GOARCH=386 before running
all.bash on amd64 machines.

cmd/go puts different architecture binaries where "go tool"
can't find them.

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

11 years agonet: allow TestDialFailPDLeak run in long-mode test
Mikio Hara [Sat, 24 Aug 2013 13:05:14 +0000 (22:05 +0900)]
net: allow TestDialFailPDLeak run in long-mode test

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

11 years agoos/user: Current support on Plan 9
Nicolas Owens [Sat, 24 Aug 2013 02:05:49 +0000 (21:05 -0500)]
os/user: Current support on Plan 9

Current for Plan 9 is implemented with /dev/user for
Uid/Gid/Username/Name, and $home environment variable for
HomeDir.

Implementing Lookup/LookupId is not done, which would
require parsing /adm/users. It is unclear of how much benefit
this would be.

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

11 years agosyscall: add Cloneflags to Linux SysProcAttr.
Rémy Oudompheng [Sat, 24 Aug 2013 01:34:07 +0000 (03:34 +0200)]
syscall: add Cloneflags to Linux SysProcAttr.

Also use clone(2) syscall instead of fork().

Fixes #6214.

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

11 years agoruntime: rename FlagNoPointers to FlagNoScan. Better represents
Keith Randall [Sat, 24 Aug 2013 00:28:47 +0000 (17:28 -0700)]
runtime: rename FlagNoPointers to FlagNoScan.  Better represents
the use of the flag, especially for objects which actually do have
pointers but we don't want the GC to scan them.

R=golang-dev, cshapiro
CC=golang-dev
https://golang.org/cl/13181045

11 years agocmd/gc: Reset haspointers computation. When converting from a
Keith Randall [Sat, 24 Aug 2013 00:28:15 +0000 (17:28 -0700)]
cmd/gc: Reset haspointers computation.  When converting from a
slice type to an array type, the haspointer-ness may change.
Before this change, we'd sometimes get types like [1]int marked
as having pointers.

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

11 years agoos/exec: remove flaky TestExtraFilesFDShuffle test
Carl Shapiro [Fri, 23 Aug 2013 23:53:32 +0000 (16:53 -0700)]
os/exec: remove flaky TestExtraFilesFDShuffle test

Update #5780

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

11 years agosyscall: define CLONE_* constants on Linux.
Rémy Oudompheng [Fri, 23 Aug 2013 20:26:49 +0000 (22:26 +0200)]
syscall: define CLONE_* constants on Linux.

Update #6214

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

11 years agoall: dragonfly support
Joel Sing [Fri, 23 Aug 2013 16:22:52 +0000 (02:22 +1000)]
all: dragonfly support

Enable remaining packages (crypto, mime, path, time) to build on dragonfly.

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

11 years agonet: dragonfly support
Joel Sing [Fri, 23 Aug 2013 16:18:22 +0000 (02:18 +1000)]
net: dragonfly support

Make the net package build and work on dragonfly.

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

11 years agoos: dragonfly support
Joel Sing [Fri, 23 Aug 2013 16:15:50 +0000 (02:15 +1000)]
os: dragonfly support

Make the os package build and work on dragonfly.

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

11 years agosyscall: dragonfly/amd64 z-files
Joel Sing [Fri, 23 Aug 2013 15:52:33 +0000 (01:52 +1000)]
syscall: dragonfly/amd64 z-files

Add generated z-files for dragonfly/amd64.

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

11 years agosyscall: dragonfly/amd64 support
Joel Sing [Fri, 23 Aug 2013 15:51:25 +0000 (01:51 +1000)]
syscall: dragonfly/amd64 support

Add syscall support for dragonfly/amd64.

Also add support for generating syscall z* files for dragonfly.

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

11 years agoruntime: add dragonfly/amd64 port
Joel Sing [Fri, 23 Aug 2013 15:50:24 +0000 (01:50 +1000)]
runtime: add dragonfly/amd64 port

Go runtime support for dragonfly/amd64, largely based of the existing
FreeBSD runtime (with some clues from the varialus/godfly work).

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

11 years agodoc: correct a minor go_mem.html mistake
Jan Mercl [Fri, 23 Aug 2013 15:40:01 +0000 (10:40 -0500)]
doc: correct a minor go_mem.html mistake

Fixes #6227

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

11 years agoA+C: Jan Mercl (individual CLA)
Brad Fitzpatrick [Fri, 23 Aug 2013 15:38:30 +0000 (10:38 -0500)]
A+C: Jan Mercl (individual CLA)

Generated by addca.

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

11 years agocmd/5l,cmd/8l: unbreak arm and 386 linkers
Joel Sing [Fri, 23 Aug 2013 15:32:01 +0000 (01:32 +1000)]
cmd/5l,cmd/8l: unbreak arm and 386 linkers

Add dragonflydynld to 5l and 8l so that they compile again.

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

11 years agoall: compiler/bootstrap for dragonfly/amd64
Joel Sing [Fri, 23 Aug 2013 15:18:04 +0000 (01:18 +1000)]
all: compiler/bootstrap for dragonfly/amd64

Add dragonfly/amd64 support to the Go compiler, bootstrap and GOOS list.

R=devon.odell, bradfitz
CC=golang-dev
https://golang.org/cl/12796050

11 years agonet: fix dial to raw IP networks on Windows
Mikio Hara [Fri, 23 Aug 2013 10:31:24 +0000 (19:31 +0900)]
net: fix dial to raw IP networks on Windows

Also avoids platform-dependent datagram truncation in raw IP tests.
At least it's different between Windows and others.

Fixes #6122.

R=alex.brainman
CC=golang-dev
https://golang.org/cl/12843043

11 years agonet: fix race in TestDNSThreadLimit
Mikio Hara [Fri, 23 Aug 2013 05:26:52 +0000 (14:26 +0900)]
net: fix race in TestDNSThreadLimit

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

11 years agonet: wait longer before failing TestVariousDeadlines4Proc on windows
Alex Brainman [Fri, 23 Aug 2013 05:07:42 +0000 (15:07 +1000)]
net: wait longer before failing TestVariousDeadlines4Proc on windows

This is an attempt to make our slow
windows-386 builder more reliable.

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

11 years agonet: update doc on socket
Mikio Hara [Fri, 23 Aug 2013 04:13:43 +0000 (13:13 +0900)]
net: update doc on socket

Also makes variable names a bit cleaner.

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

11 years agonet: add test for protocol numbers lookup using internal information base
Mikio Hara [Thu, 22 Aug 2013 03:13:54 +0000 (12:13 +0900)]
net: add test for protocol numbers lookup using internal information base

Update #5344

R=alex.brainman
CC=golang-dev
https://golang.org/cl/12966046

11 years agonet: fix misspelled variable name (fixes windows build)
Alex Brainman [Thu, 22 Aug 2013 02:34:05 +0000 (12:34 +1000)]
net: fix misspelled variable name (fixes windows build)

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

11 years agonet: add minimal internet protocol number information base
Mikio Hara [Thu, 22 Aug 2013 01:33:37 +0000 (10:33 +0900)]
net: add minimal internet protocol number information base

This CL adds minimal information for supporting platforms that don't
have a complete list of internet protocol numbers.

Fixes #5344.

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

11 years agonet: remove redundant argument check from Dial on udp, unix networks
Mikio Hara [Thu, 22 Aug 2013 01:33:06 +0000 (10:33 +0900)]
net: remove redundant argument check from Dial on udp, unix networks

The net package consists of thin three layers like the follwoing;

- Exposed API, that contains net.Dial, net.DialUDP, net.DialUnix
- Socket and network file descriptor, that contains net.netFD and
  its methods, helper functions such as dialUDP, dialUnix
- Network pollster, that contains net.pollDesc and its methods

This CL removes redundant argument check which is already done by
API layer.

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

11 years agodoc: hide playground on front page if playground disabled
Andrew Gerrand [Thu, 22 Aug 2013 01:12:44 +0000 (11:12 +1000)]
doc: hide playground on front page if playground disabled

Fixes #5630.

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

11 years agosyscall: fix stale URL for linux/arm unistd.h
Rémy Oudompheng [Wed, 21 Aug 2013 22:59:48 +0000 (00:59 +0200)]
syscall: fix stale URL for linux/arm unistd.h

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

11 years agoruntime: do not trigger GC on g0
Dmitriy Vyukov [Wed, 21 Aug 2013 22:17:45 +0000 (02:17 +0400)]
runtime: do not trigger GC on g0
GC acquires worldsema, which is a goroutine-level semaphore
which parks goroutines. g0 can not be parked.
Fixes #6193.

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

11 years agoundo CL 13010045 / 04f8101b46dd
Carl Shapiro [Wed, 21 Aug 2013 20:51:00 +0000 (13:51 -0700)]
undo CL 13010045 / 04f8101b46dd

Update the original change but do not read interface types in
the arguments area.  Once the arguments area is zeroed as the
locals area is we can safely read interface type values there
too.

««« original CL description
undo CL 12785045 / 71ce80dc4195

This has broken the 32-bit builds.

««« original CL description
cmd/gc, runtime: use type information to scan interface values

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»

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

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

11 years agotime: make timers heap 4-ary
Sokolov Yura [Wed, 21 Aug 2013 14:51:37 +0000 (18:51 +0400)]
time: make timers heap 4-ary

This slightly improves performance when a lot of timers are present

$ misc/benchcmp ../old_timers_m.txt ../new_timers_m.txt
benchmark                           old ns/op    new ns/op    delta
BenchmarkAfterFunc                       6884         6605   -4.05%
BenchmarkAfterFunc-2                     4473         4144   -7.36%
BenchmarkAfterFunc-3                     8601         6185  -28.09%
BenchmarkAfterFunc-4                     9378         8773   -6.45%
BenchmarkAfter                           7237         7278   +0.57%
BenchmarkAfter-2                         4638         3923  -15.42%
BenchmarkAfter-3                         8751         6239  -28.71%
BenchmarkAfter-4                         9223         8737   -5.27%
BenchmarkStop                             603          496  -17.74%
BenchmarkStop-2                           795          577  -27.42%
BenchmarkStop-3                           982          680  -30.75%
BenchmarkStop-4                          1164          739  -36.51%
BenchmarkSimultaneousAfterFunc            657          593   -9.74%
BenchmarkSimultaneousAfterFunc-2          816          757   -7.23%
BenchmarkSimultaneousAfterFunc-3          844          830   -1.66%
BenchmarkSimultaneousAfterFunc-4          785          771   -1.78%
BenchmarkStartStop                        238          239   +0.42%
BenchmarkStartStop-2                      249          234   -6.02%
BenchmarkStartStop-3                      271          268   -1.11%
BenchmarkStartStop-4                      293          295   +0.68%

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

11 years agonet: ensure that Read/Write on all platforms do 0 mallocs
Dmitriy Vyukov [Wed, 21 Aug 2013 10:21:02 +0000 (14:21 +0400)]
net: ensure that Read/Write on all platforms do 0 mallocs

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

11 years agocmd/5g, cmd/6g, cmd/8g: faster compilation
Dmitriy Vyukov [Wed, 21 Aug 2013 10:20:28 +0000 (14:20 +0400)]
cmd/5g, cmd/6g, cmd/8g: faster compilation
Replace linked list walk with memset.
This reduces CPU time taken by 'go install -a std' by ~10%.
Before:
real user sys
0m23.561s 0m16.625s 0m5.848s
0m23.766s 0m16.624s 0m5.846s
0m23.742s 0m16.621s 0m5.868s
after:
0m22.714s 0m14.858s 0m6.138s
0m22.644s 0m14.875s 0m6.120s
0m22.604s 0m14.854s 0m6.081s

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

11 years agodoc/go1.2.txt: cmd/5l: support for external linking for linux/arm
Elias Naur [Wed, 21 Aug 2013 07:45:35 +0000 (17:45 +1000)]
doc/go1.2.txt: cmd/5l: support for external linking for linux/arm

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

11 years agoreflect: Fix Convert to add indir bit when the value is actually a
Todd Wang [Wed, 21 Aug 2013 04:41:55 +0000 (14:41 +1000)]
reflect: Fix Convert to add indir bit when the value is actually a
pointer.  An example that triggers the bad behavior on a 64bit
machine http://play.golang.org/p/GrNFakAYLN
        rv1 := reflect.ValueOf(complex128(0))
        rt := rv1.Type()
        rv2 := rv1.Convert(rt)
        rv3 := reflect.New(rt).Elem()
        rv3.Set(rv2)

Running the code fails with the following:
        panic: reflect: internal error: storeIword of 16-byte value

I've tested on a 64bit machine and verified this fixes the panic.  I
haven't tested on a 32bit machine so I haven't verified the other
cases, but they follow logically.

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

11 years agoC: add Todd Wang (Google CLA).
David Symonds [Wed, 21 Aug 2013 04:02:58 +0000 (14:02 +1000)]
C: add Todd Wang (Google CLA).

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

11 years agoall: protect alloc count tests by -testing.short
Rob Pike [Wed, 21 Aug 2013 04:00:45 +0000 (14:00 +1000)]
all: protect alloc count tests by -testing.short

Update #5000
Should reduce the flakiness a little. Malloc counting is important
to general testing but not to the build dashboard, which uses -short.

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

11 years agodoc/go1.2.txt: text/template: add comparison functions
Rob Pike [Wed, 21 Aug 2013 02:55:09 +0000 (12:55 +1000)]
doc/go1.2.txt: text/template: add comparison functions

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

11 years agotext/template: implement comparison of basic types
Rob Pike [Wed, 21 Aug 2013 01:27:27 +0000 (11:27 +1000)]
text/template: implement comparison of basic types

Add eq, lt, etc. to allow one to do simple comparisons.
It's basic types only (booleans, integers, unsigned integers,
floats, complex, string) because that's easy, easy to define,
and covers the great majority of useful cases, while leaving
open the possibility of a more sweeping definition later.

{{if eq .X .Y}}X and Y are equal{{else}}X and Y are unequal{{end}}

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

11 years agodoc/go1.2.txt: net: performance improvement on BSD
Mikio Hara [Wed, 21 Aug 2013 00:53:17 +0000 (09:53 +0900)]
doc/go1.2.txt: net: performance improvement on BSD

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

11 years agodoc/go1.2.txt: archive/tar's fixed FileInfo
Rob Pike [Tue, 20 Aug 2013 22:37:32 +0000 (08:37 +1000)]
doc/go1.2.txt: archive/tar's fixed FileInfo

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

11 years agodoc: remove a insignificant line from go1.2.txt
Brad Fitzpatrick [Tue, 20 Aug 2013 22:35:07 +0000 (15:35 -0700)]
doc: remove a insignificant line from go1.2.txt

Not a user-visible API change.  Just a minor garbage
win in contrived cases.

Also, the package is io/ioutil.

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

11 years agoarchive/tar,zip: implement the os.FileInfo interface correctly.
Rob Pike [Tue, 20 Aug 2013 22:29:41 +0000 (08:29 +1000)]
archive/tar,zip: implement the os.FileInfo interface correctly.
This is potentially an API-breaking change, but it is an important bug fix.

The CL https://golang.org/cl/7305072/ added stuff to make
the tar file look more like a file system internally, including providing an
implementation of os.FileInfo for the file headers within the archive.
But the code is incorrect because FileInfo.Name is supposed to return
the base name only; this implementation returns the full path. A round
trip test added in the same shows this in action, as the slashes are
preserved as we create a header using the local implementation of
FileInfo.

The CL here changes the behavior of the tar (and zip) FileInfo to honor
the Go spec for that interface. It also clarifies that the FileInfoHeader
function, which takes a FileInfo as an argument, will therefore create
a header with only the base name of the file recorded, and that
subsequent adjustment may be necessary.

There may be code out there that depends on the broken behavior.
We can call out the risk in the release notes.

Fixes #6180.

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

11 years agoA+C: Sokolov Yura (individual CLA)
Brad Fitzpatrick [Tue, 20 Aug 2013 15:21:58 +0000 (08:21 -0700)]
A+C: Sokolov Yura (individual CLA)

Generated by addca.

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

11 years agomisc/xcode: use `xcode-select` to determine path
Emil Hessman [Tue, 20 Aug 2013 10:48:29 +0000 (20:48 +1000)]
misc/xcode: use `xcode-select` to determine path

If xcode-select is available, use it to determine the path to the
DVTFoundation.xcplugindata file.

Fixes #5997.

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

11 years agonet: remove obsolete builtin network pollster
Mikio Hara [Tue, 20 Aug 2013 08:32:55 +0000 (17:32 +0900)]
net: remove obsolete builtin network pollster

Update #5199
Update #6146

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

11 years agonet: enable runtime-integrated network pollster on freebsd/arm
Mikio Hara [Tue, 20 Aug 2013 08:02:42 +0000 (17:02 +0900)]
net: enable runtime-integrated network pollster on freebsd/arm

Fixes #6146.

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

11 years agoruntime: integrated network pollster for freebsd/arm
Mikio Hara [Tue, 20 Aug 2013 07:57:30 +0000 (16:57 +0900)]
runtime: integrated network pollster for freebsd/arm

Update #6146

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

11 years agonet/http: support WriteString on the ResponseWriter
Brad Fitzpatrick [Tue, 20 Aug 2013 05:56:54 +0000 (22:56 -0700)]
net/http: support WriteString on the ResponseWriter

Fixes #5377

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

11 years agoos: fix windows build
Rob Pike [Tue, 20 Aug 2013 04:45:46 +0000 (14:45 +1000)]
os: fix windows build
The os windows source uses file as the receiver, not f.
TBR=golang-dev@googlegroups.com

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

11 years agoos: be consistent about File methods with nil receivers
Rob Pike [Tue, 20 Aug 2013 04:33:03 +0000 (14:33 +1000)]
os: be consistent about File methods with nil receivers
Some crashed, some didn't. Make a nil receiver always
return ErrInvalid rather than crash.
Fixes #5824.
The program in the bug listing is silent now, at least on my Mac.

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

11 years agoapi: update next.txt, except.txt
Rob Pike [Tue, 20 Aug 2013 01:14:45 +0000 (11:14 +1000)]
api: update next.txt, except.txt

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

11 years agotest: exit non-zero on error from nilptr2.go.
Alan Donovan [Mon, 19 Aug 2013 21:50:22 +0000 (17:50 -0400)]
test: exit non-zero on error from nilptr2.go.

(For go.tools/ssa/interp/interp_test, which runs a subset of
these tests under this assumption.)

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

11 years agoundo CL 12785045 / 71ce80dc4195
Carl Shapiro [Mon, 19 Aug 2013 21:16:55 +0000 (14:16 -0700)]
undo CL 12785045 / 71ce80dc4195

This has broken the 32-bit builds.

««« original CL description
cmd/gc, runtime: use type information to scan interface values

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»

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

11 years agodoc/go_faq.html: link to the SPLASH talk near the top
Rob Pike [Mon, 19 Aug 2013 20:44:41 +0000 (06:44 +1000)]
doc/go_faq.html: link to the SPLASH talk near the top
It's a full answer to the first question; let's let readers know that.

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

11 years agomisc/emacs: Detect stale coverage reports
Aaron France [Mon, 19 Aug 2013 20:32:00 +0000 (16:32 -0400)]
misc/emacs: Detect stale coverage reports

When the coverage report file is older than the file we're
showing the coverage report for, then we show a simple message
to state this fact.

R=adonovan, dominik.honnef, bradfitz
CC=golang-dev
https://golang.org/cl/12919044

11 years agoA+C: Aaron France (individual CLA)
Brad Fitzpatrick [Mon, 19 Aug 2013 20:30:31 +0000 (13:30 -0700)]
A+C: Aaron France (individual CLA)

Generated by addca.

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

11 years agoruntime: don't run finalizers if we're still on the g0 stack.
Keith Randall [Mon, 19 Aug 2013 19:20:50 +0000 (12:20 -0700)]
runtime: don't run finalizers if we're still on the g0 stack.

R=golang-dev, rsc, dvyukov, khr
CC=golang-dev
https://golang.org/cl/11386044

11 years agonet: annotate Read/Write for race detector
Dmitriy Vyukov [Mon, 19 Aug 2013 19:09:24 +0000 (23:09 +0400)]
net: annotate Read/Write for race detector
Fixes #6167.

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

11 years agoruntime: do not preempt race calls
Dmitriy Vyukov [Mon, 19 Aug 2013 19:06:46 +0000 (23:06 +0400)]
runtime: do not preempt race calls
In the crash stack trace race cgocall() calls endcgo(),
this means that m->racecall is wrong.
Indeed this can happen is a goroutine is rescheduled to another M
during race call.
Disable preemption for race calls.
Fixes #6155.

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

11 years agocmd/gc, runtime: use type information to scan interface values
Carl Shapiro [Mon, 19 Aug 2013 17:19:59 +0000 (10:19 -0700)]
cmd/gc, runtime: use type information to scan interface values

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

11 years agocmd/go: only try to clean executables for package main
Andrew Gerrand [Mon, 19 Aug 2013 06:22:33 +0000 (16:22 +1000)]
cmd/go: only try to clean executables for package main

Fixes #5665.

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