]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agomisc/dashboard/builder: add -race builder support
Dave Cheney [Tue, 9 Apr 2013 02:48:04 +0000 (12:48 +1000)]
misc/dashboard/builder: add -race builder support

If the build key contains -race, the builder will invoke to the race.{bat,bash} build command. This allows {darwin,linux,windows}-amd64 builders to do race and non race builds in sequence.

R=adg, dvyukov, fullung
CC=golang-dev
https://golang.org/cl/8266046

12 years agoruntime: fix integer overflow in hashmap
Dmitriy Vyukov [Tue, 9 Apr 2013 01:56:38 +0000 (18:56 -0700)]
runtime: fix integer overflow in hashmap
The test is problematic, because it requires 8GB+ of RAM.
Fixes #5239.

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

12 years agonet: add test for runtime.PollDesc leak
Dave Cheney [Tue, 9 Apr 2013 01:14:22 +0000 (11:14 +1000)]
net: add test for runtime.PollDesc leak

See 8318044

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

12 years agocmd/cgo: record CGO_LDFLAGS env var in _cgo_flags
Andrew Wilkins [Mon, 8 Apr 2013 23:35:06 +0000 (07:35 +0800)]
cmd/cgo: record CGO_LDFLAGS env var in _cgo_flags

cgo stores cgo LDFLAGS in _cgo_flags and _cgo_defun.c.
The _cgo_defun.c records the flags via
"#pragma cgo_ldflag <flag>", which external linking
relies upon for passing libraries (and search paths)
to the host linker.

The go command will allow LDFLAGS for cgo to be passed
through the environment (CGO_LDFLAGS); cgo ignores
this environment variable, and so its value doesn't
make it into the above mentioned files. This CL changes
cgo to record CGO_LDFLAGS also.

Fixes #5205.

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

12 years agosync, sync/atomic: do not corrupt race detector after a nil dereference.
Rémy Oudompheng [Mon, 8 Apr 2013 21:46:54 +0000 (23:46 +0200)]
sync, sync/atomic: do not corrupt race detector after a nil dereference.

The race detector uses a global lock to analyze atomic
operations. A panic in the middle of the code leaves the
lock acquired.

Similarly, the sync package may leave the race detectro
inconsistent when methods are called on nil pointers.

R=golang-dev, r, minux.ma, dvyukov, rsc, adg
CC=golang-dev
https://golang.org/cl/7981043

12 years agoruntime: poor man's heap type info checker
Dmitriy Vyukov [Mon, 8 Apr 2013 20:36:35 +0000 (13:36 -0700)]
runtime: poor man's heap type info checker
It's not trivial to make a comprehensive check
due to inferior pointers, reflect, gob, etc.
But this is essentially what I've used to debug
the GC issues.
Update #5193.

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

12 years agotest: fix mapnan.go build tag
Brad Fitzpatrick [Mon, 8 Apr 2013 07:09:35 +0000 (00:09 -0700)]
test: fix mapnan.go build tag

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

12 years agocmd/gc: properly set variadic flag on method values.
Rémy Oudompheng [Mon, 8 Apr 2013 06:59:33 +0000 (08:59 +0200)]
cmd/gc: properly set variadic flag on method values.

Fixes #5231.

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

12 years agocmd/go: fix a misleading sentence
Rob Pike [Mon, 8 Apr 2013 06:27:26 +0000 (23:27 -0700)]
cmd/go: fix a misleading sentence
Apologies for not reviewing the previous CL; I was on the road.
The text was misleading; execution is no more separate than with
any other test. Rewritten. Dropped the odd adverb.

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

12 years agocmd/go: clarify what "pkg.test" means wrt the -c flag
Andrew Gerrand [Mon, 8 Apr 2013 06:03:19 +0000 (16:03 +1000)]
cmd/go: clarify what "pkg.test" means wrt the -c flag

Fixes #5230.

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

12 years agoarchive/zip: handle trailing data after the end of directory header
Andrew Gerrand [Mon, 8 Apr 2013 05:38:06 +0000 (15:38 +1000)]
archive/zip: handle trailing data after the end of directory header

The spec doesn't explicitly say that trailing data is okay, but a lot
of people do this and most unzippers will handle it just fine. In any
case, this makes the package more useful, and led me to make the
directory parsing code marginally more robust.

Fixes #5228.

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

12 years agocmd/go: document usage of external test packages
Kamil Kisiel [Mon, 8 Apr 2013 04:42:06 +0000 (14:42 +1000)]
cmd/go: document usage of external test packages

Fixes #5144

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

12 years agodoc: fix typos in go1.1.html
Jonathan Rudenberg [Mon, 8 Apr 2013 02:04:50 +0000 (12:04 +1000)]
doc: fix typos in go1.1.html

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

12 years agoreflect: document the unreliability of StringHeader and SliceHeader
Rob Pike [Mon, 8 Apr 2013 01:42:47 +0000 (18:42 -0700)]
reflect: document the unreliability of StringHeader and SliceHeader

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

12 years agodoc: document go1.1 build tag
Andrew Gerrand [Mon, 8 Apr 2013 01:41:01 +0000 (11:41 +1000)]
doc: document go1.1 build tag

Fixes #5235.

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

12 years agoruntime: fix race on hashmap flags field
Dmitriy Vyukov [Mon, 8 Apr 2013 01:19:16 +0000 (18:19 -0700)]
runtime: fix race on hashmap flags field
Use atomic operations on flags field to make sure we aren't
losing a flag update during parallel map operations.

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

12 years agogo/ast: fix typo in Fprint documentation
Alexei Sholik [Sun, 7 Apr 2013 23:50:23 +0000 (16:50 -0700)]
go/ast: fix typo in Fprint documentation

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

12 years agoundo CL 8363045 / a3ce42f9748b
David Symonds [Sun, 7 Apr 2013 21:59:47 +0000 (07:59 +1000)]
undo CL 8363045 / a3ce42f9748b

It changes an exported API, and breaks the build.

««« original CL description
reflect: use unsafe.Pointer in StringHeader and SliceHeader

Relates to issue 5193.

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

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

12 years agoreflect: use unsafe.Pointer in StringHeader and SliceHeader
Jan Ziak [Sun, 7 Apr 2013 21:33:40 +0000 (23:33 +0200)]
reflect: use unsafe.Pointer in StringHeader and SliceHeader

Relates to issue 5193.

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

12 years agotest: fix flaky NaN-key map complexity test
Brad Fitzpatrick [Sun, 7 Apr 2013 18:56:15 +0000 (11:56 -0700)]
test: fix flaky NaN-key map complexity test

Don't measure wall time in map.go. Keep it portable
and only test NaN, but not time.

Move time tests to mapnan.go and only measure user CPU time,
not wall time. It builds on Darwin and Linux, the primary
platforms where people hack on the runtime & in particular
maps. The runtime is shared, though, so we don't need it to
run on all of the platforms.

Fixes flaky build failures like:
http://build.golang.org/log/ba67eceefdeaa1142cb6c990a62fa3ffd8fd73f8

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

12 years agoruntime, runtime/debug, runtime/race: deflake tests
Albert Strasheim [Sun, 7 Apr 2013 18:37:37 +0000 (11:37 -0700)]
runtime, runtime/debug, runtime/race: deflake tests

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

12 years agolib9: handle empty TMPDIR more gracefully.
Albert Strasheim [Sun, 7 Apr 2013 18:16:15 +0000 (11:16 -0700)]
lib9: handle empty TMPDIR more gracefully.

Before, an empty TMPDIR would lead to:
cannot create <nil>/go.o: No such file or directory

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

12 years agoruntime: gofmt -s
Albert Strasheim [Sun, 7 Apr 2013 08:37:32 +0000 (18:37 +1000)]
runtime: gofmt -s

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

12 years agoruntime: fix deadlock in network poller
Dmitriy Vyukov [Sun, 7 Apr 2013 05:27:54 +0000 (22:27 -0700)]
runtime: fix deadlock in network poller
The invariant is that there must be at least one running P or a thread polling network.
It was broken.
Fixes #5216.

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

12 years agoruntime: make CgoMal alloc field void*
Ian Lance Taylor [Sun, 7 Apr 2013 03:18:15 +0000 (20:18 -0700)]
runtime: make CgoMal alloc field void*

This makes it an unsafe.Pointer in Go so the garbage collector
will treat it as a pointer to untyped data, not a pointer to
bytes.

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

12 years agoruntime: change Note from union to struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:09:02 +0000 (20:09 -0700)]
runtime: change Note from union to struct
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: change Lock from union to struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:07:07 +0000 (20:07 -0700)]
runtime: change Lock from union to struct
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: replace unions with structs
Dmitriy Vyukov [Sun, 7 Apr 2013 03:02:49 +0000 (20:02 -0700)]
runtime: replace unions with structs
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: replace union in MHeap with a struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:02:03 +0000 (20:02 -0700)]
runtime: replace union in MHeap with a struct
Unions break precise GC.
Update #5193.

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

12 years agoruntime: reset dangling typed pointer
Dmitriy Vyukov [Sun, 7 Apr 2013 03:01:28 +0000 (20:01 -0700)]
runtime: reset dangling typed pointer
+untype it because it can point to different types
Update #5193.

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

12 years agoruntime: reset typed dangling pointer
Dmitriy Vyukov [Sun, 7 Apr 2013 03:00:45 +0000 (20:00 -0700)]
runtime: reset typed dangling pointer
If for whatever reason seh points into Go heap region,
the dangling pointer will cause memory corruption during GC.
Update #5193.

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

12 years agomisc: update zsh completion
Jonathan Rudenberg [Sat, 6 Apr 2013 20:11:12 +0000 (04:11 +0800)]
misc: update zsh completion

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

12 years agocmd/go: fix capitalization of Bitbucket, document Git support
John Howard Palevich [Sat, 6 Apr 2013 20:06:11 +0000 (04:06 +0800)]
cmd/go: fix capitalization of Bitbucket, document Git support

Fixes #5226.

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

12 years agoA+C: John Howard Palevich (individual CLA)
Ian Lance Taylor [Sat, 6 Apr 2013 14:13:31 +0000 (07:13 -0700)]
A+C: John Howard Palevich (individual CLA)

Generated by addca.

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

12 years agonet/http: fix typo in ErrMissingBoundary
Jonathan Rudenberg [Fri, 5 Apr 2013 22:23:03 +0000 (15:23 -0700)]
net/http: fix typo in ErrMissingBoundary

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

12 years agocmd/gc: fix Offsetof computation.
Rémy Oudompheng [Fri, 5 Apr 2013 19:24:07 +0000 (21:24 +0200)]
cmd/gc: fix Offsetof computation.

The offset of an embedded field s.X must be relative to s
and not to the implicit s.Field of which X is a direct field.
Moreover, no indirections may happen on the path.

Fixes #4909.

R=nigeltao, ality, daniel.morsing, iant, gri, r
CC=golang-dev
https://golang.org/cl/8287043

12 years agotesting: structure package documentation
Volker Dobler [Fri, 5 Apr 2013 02:43:18 +0000 (13:43 +1100)]
testing: structure package documentation

Makes finding the relevant information much easier.

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

12 years agostrconv: remove some test TODOs and adjust malloc limits lower
Brad Fitzpatrick [Fri, 5 Apr 2013 00:04:18 +0000 (17:04 -0700)]
strconv: remove some test TODOs and adjust malloc limits lower

These no longer allocate.

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

12 years agoruntime: use a distinct pattern to mark free blocks in need of zeroing
Carl Shapiro [Thu, 4 Apr 2013 21:18:52 +0000 (14:18 -0700)]
runtime: use a distinct pattern to mark free blocks in need of zeroing

R=golang-dev, dvyukov, khr, cshapiro
CC=golang-dev
https://golang.org/cl/8392043

12 years agogodoc: enable visibility of element linked from URL hash
Kamil Kisiel [Thu, 4 Apr 2013 21:04:02 +0000 (08:04 +1100)]
godoc: enable visibility of element linked from URL hash

Expands the example when visiting a URL such as
http://golang.org/pkg/net/http/#example_Hijacker

Fixes #5212.

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

12 years agonet/http: remove some obsolete TODOs
Brad Fitzpatrick [Thu, 4 Apr 2013 20:40:26 +0000 (13:40 -0700)]
net/http: remove some obsolete TODOs

We've decided to leave logging to third-parties (there are too
many formats), which others have done.

And we can't change the behavior of the various response
fields at this point anyway. Plus I argue they're correct and
match their documention.

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

12 years agonet/http: better stand-alone FileServer doc example
Brad Fitzpatrick [Thu, 4 Apr 2013 20:40:15 +0000 (13:40 -0700)]
net/http: better stand-alone FileServer doc example

Motivated by a deletion in the wiki, which had a better
example.

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

12 years agocmd/gc: fix a typo
Carl Shapiro [Thu, 4 Apr 2013 18:42:01 +0000 (11:42 -0700)]
cmd/gc: fix a typo

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

12 years agodoc/code.html: fix typos
Andriy Lytvynov [Thu, 4 Apr 2013 18:11:54 +0000 (11:11 -0700)]
doc/code.html: fix typos

Fixed example program's output to match program's code.
Fixes #5204.

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

12 years agoA+C: Andriy Lytvynov (individual CLA)
Rob Pike [Thu, 4 Apr 2013 18:11:45 +0000 (11:11 -0700)]
A+C: Andriy Lytvynov (individual CLA)

Generated by addca.

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

12 years agodoc: use the already defined GOPATH in PATH
Duncan Holm [Thu, 4 Apr 2013 05:36:10 +0000 (16:36 +1100)]
doc: use the already defined GOPATH in PATH

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

12 years agoA+C: Duncan Holm (individual CLA)
Andrew Gerrand [Thu, 4 Apr 2013 05:35:29 +0000 (16:35 +1100)]
A+C: Duncan Holm (individual CLA)

Generated by addca.

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

12 years agodoc/go1.1.html: mention cgo and cross compilation
Dave Cheney [Thu, 4 Apr 2013 05:13:29 +0000 (16:13 +1100)]
doc/go1.1.html: mention cgo and cross compilation

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

12 years agodoc: mention availability of race detector in go1.1 doc
Andrew Gerrand [Thu, 4 Apr 2013 05:10:30 +0000 (16:10 +1100)]
doc: mention availability of race detector in go1.1 doc

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

12 years agomisc/dist: only build race toolchain where available, fix file upload
Andrew Gerrand [Thu, 4 Apr 2013 03:46:54 +0000 (14:46 +1100)]
misc/dist: only build race toolchain where available, fix file upload

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

12 years agomisc/dist: add -version flag to override version name
Andrew Gerrand [Thu, 4 Apr 2013 03:21:19 +0000 (14:21 +1100)]
misc/dist: add -version flag to override version name

Also, don't build the tour when making the source distribution.

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

12 years agountag go1.1beta1
Andrew Gerrand [Thu, 4 Apr 2013 02:51:20 +0000 (13:51 +1100)]
untag go1.1beta1

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

12 years agotag go1.1beta1
Andrew Gerrand [Thu, 4 Apr 2013 02:41:14 +0000 (13:41 +1100)]
tag go1.1beta1

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

12 years agocmd/nm: don't add filename elements for m symbols
Anthony Martin [Thu, 4 Apr 2013 01:23:43 +0000 (18:23 -0700)]
cmd/nm: don't add filename elements for m symbols

The compilers used to generate only one 'm' symbol
to record the stack frame size for each function.

In cmd/nm, the 'm' and 'f' symbols are handled in
the same switch case with a special exception for
the symbol described above called ".frame".

Now that the compilers emit additional 'm' symbols
for precise garbage collection of the stack, the
current logic is incorrect. cmd/nm will attempt to
interpret these new 'm' symbols as 'f' symbols and
add them to the file name index table.

This fails with an out-of-memory condition when
zenter encounters an 'm' symbol with a very large
value (usually the .args symbol indicating a
variadic NOSPLIT function).

R=iant
CC=dave, gobot, golang-dev, rsc
https://golang.org/cl/7962045

12 years agomisc/dist: don't ship race-enabled commands
Andrew Gerrand [Thu, 4 Apr 2013 01:07:53 +0000 (12:07 +1100)]
misc/dist: don't ship race-enabled commands

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

12 years agocmd/go: run main package when no files are listed
Jonathan Rudenberg [Thu, 4 Apr 2013 01:04:35 +0000 (12:04 +1100)]
cmd/go: run main package when no files are listed

Fixes 5164.

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

12 years agodoc: fix typos in go1.1
Dmitriy Vyukov [Thu, 4 Apr 2013 00:03:42 +0000 (17:03 -0700)]
doc: fix typos in go1.1

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

12 years agodoc: fix typos and trailing spaces
Alexei Sholik [Wed, 3 Apr 2013 23:44:03 +0000 (16:44 -0700)]
doc: fix typos and trailing spaces

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

12 years agoA+C: added Alexei Sholik (individual CLA)
Robert Griesemer [Wed, 3 Apr 2013 23:41:53 +0000 (16:41 -0700)]
A+C: added Alexei Sholik (individual CLA)

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

12 years agoruntime: fix data/bss shadow memory mapping for race detector
Dmitriy Vyukov [Wed, 3 Apr 2013 22:11:34 +0000 (09:11 +1100)]
runtime: fix data/bss shadow memory mapping for race detector
Fixes #5175.
Race detector runtime expects values passed to MapShadow() to be page-aligned,
because they are used in mmap() call. If they are not aligned mmap() trims
either beginning or end of the mapping.

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

12 years agodoc: mention godoc.org in "How to Write Go Code"
Andrew Gerrand [Wed, 3 Apr 2013 21:56:11 +0000 (08:56 +1100)]
doc: mention godoc.org in "How to Write Go Code"

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

12 years agodoc: simplify How to write Go code article
Andrew Gerrand [Wed, 3 Apr 2013 21:19:24 +0000 (08:19 +1100)]
doc: simplify How to write Go code article

This version just tells you what to do, rather
than trying to teach you how it all works.
Should be much better for newcomers.

R=dave, gary.burd, alcosholik, r
CC=golang-dev
https://golang.org/cl/8247044

12 years agomisc/dist: include race detector packages in binary distributions
Andrew Gerrand [Wed, 3 Apr 2013 21:06:29 +0000 (08:06 +1100)]
misc/dist: include race detector packages in binary distributions

Fixes #4596.

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

12 years agodoc: link the race detector document into the release notes
Rob Pike [Wed, 3 Apr 2013 20:56:24 +0000 (13:56 -0700)]
doc: link the race detector document into the release notes
Also:
- put GORACE into the go env command
- do minor housekeeping on the race detector article

Fixes #4995.

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

12 years agodoc/go1.1.html: document the state of gccgo
Rob Pike [Wed, 3 Apr 2013 20:29:06 +0000 (13:29 -0700)]
doc/go1.1.html: document the state of gccgo
Fixes #5053.

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

12 years agomath/big: minor cleanups
Robert Griesemer [Wed, 3 Apr 2013 20:24:32 +0000 (13:24 -0700)]
math/big: minor cleanups

- comment fixes
- s/z/x/ in (*rat).Float64 to match convention for functions
  returning a non-*Rat
- minor test output tweaking

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

12 years agodatabase/sql: improve standard deviation response time under high concurrency
James Tucker [Wed, 3 Apr 2013 18:13:40 +0000 (11:13 -0700)]
database/sql: improve standard deviation response time under high concurrency

See https://github.com/raggi/go-and-java for runtime benchmark.

The patch reduces the amount of map key search, moving connection oriented
variables onto the connection structs.

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

12 years agoC: add James Tucker (Google CLA)
Brad Fitzpatrick [Wed, 3 Apr 2013 18:12:25 +0000 (11:12 -0700)]
C: add James Tucker (Google CLA)

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

12 years agodoc/go1.1.html: document os/signal.Stop
Rob Pike [Wed, 3 Apr 2013 17:59:36 +0000 (10:59 -0700)]
doc/go1.1.html: document os/signal.Stop
Also fix the sort order of the laundry list.

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

12 years agonet/smtp: allow PLAIN auth when advertised
Brad Fitzpatrick [Wed, 3 Apr 2013 17:52:20 +0000 (10:52 -0700)]
net/smtp: allow PLAIN auth when advertised

The smtp package originally allowed PLAIN whenever, but then
the TLS check was added for paranoia, but it's too paranoid:
it prevents using PLAIN auth even from localhost to localhost
when the server advertises PLAIN support.

This CL also permits the client to send PLAIN if the server
advertises it.

Fixes #5184

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

12 years agoapi: update next.txt.
Brad Fitzpatrick [Wed, 3 Apr 2013 17:41:28 +0000 (10:41 -0700)]
api: update next.txt.

Update #4871

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

12 years agodoc/go1.1.html: state that the heap is bigger on 64-bit machines
Rob Pike [Wed, 3 Apr 2013 17:40:33 +0000 (10:40 -0700)]
doc/go1.1.html: state that the heap is bigger on 64-bit machines
Be deliberately vague, since the precise details should not be depended upon.
Fixes #5155.

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

12 years agobufio: make it a little clearer how the default Scanner splits lines.
Rob Pike [Wed, 3 Apr 2013 17:40:04 +0000 (10:40 -0700)]
bufio: make it a little clearer how the default Scanner splits lines.
Just commentary, no semantic change.

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

12 years agonet/http: don't allocate 0-byte io.LimitedReaders for GET requests
Brad Fitzpatrick [Wed, 3 Apr 2013 17:31:12 +0000 (10:31 -0700)]
net/http: don't allocate 0-byte io.LimitedReaders for GET requests

Save an allocation per GET request and don't call io.LimitedReader(r, 0)
just to read 0 bytes.  There's already an eofReader global variable
for when we just want a non-nil io.Reader to immediately EOF.

(Sorry, I know Rob told me to stop, but I was bored on the plane and
wrote this before I received the recent "please, really stop" email.)

benchmark                         old ns/op    new ns/op    delta
BenchmarkServerHandlerTypeLen         13888        13279   -4.39%
BenchmarkServerHandlerNoLen           12912        12229   -5.29%
BenchmarkServerHandlerNoType          13348        12632   -5.36%
BenchmarkServerHandlerNoHeader        10911        10261   -5.96%

benchmark                        old allocs   new allocs    delta
BenchmarkServerHandlerTypeLen            20           19   -5.00%
BenchmarkServerHandlerNoLen              18           17   -5.56%
BenchmarkServerHandlerNoType             18           17   -5.56%
BenchmarkServerHandlerNoHeader           13           12   -7.69%

benchmark                         old bytes    new bytes    delta
BenchmarkServerHandlerTypeLen          1913         1878   -1.83%
BenchmarkServerHandlerNoLen            1878         1843   -1.86%
BenchmarkServerHandlerNoType           1878         1844   -1.81%
BenchmarkServerHandlerNoHeader         1085         1051   -3.13%

Fixes #5188

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

12 years agobytes: don't leave mprotect-ed pages after unsafe test.
Rémy Oudompheng [Wed, 3 Apr 2013 15:30:20 +0000 (08:30 -0700)]
bytes: don't leave mprotect-ed pages after unsafe test.

Fixes inscrutable GC faults during testing.

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

12 years agogo/parser: ParseExpr must accept type expressions
Robert Griesemer [Wed, 3 Apr 2013 14:41:26 +0000 (07:41 -0700)]
go/parser: ParseExpr must accept type expressions

My old code was trying to be too smart.
Also: Slightly better error message format
for gofmt -r pattern errors.

Fixes #4406.

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

12 years agoA+C: zorion arrizabalaga (individual CLA)
Andrew Gerrand [Wed, 3 Apr 2013 09:32:50 +0000 (20:32 +1100)]
A+C: zorion arrizabalaga (individual CLA)

Generated by addca.

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

12 years agogo/build: disable cgo when cross compiling
Dave Cheney [Wed, 3 Apr 2013 08:13:37 +0000 (19:13 +1100)]
go/build: disable cgo when cross compiling

Fixes #5141.

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

12 years agocmd/gc: be more tolerant with recursive types when checking map types.
Rémy Oudompheng [Wed, 3 Apr 2013 06:18:30 +0000 (08:18 +0200)]
cmd/gc: be more tolerant with recursive types when checking map types.

A nested TFORW type would push algtype1 into an impossible case.

Fixes #5125.

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

12 years agospec: Go has no 'reference types'
Robert Griesemer [Wed, 3 Apr 2013 06:17:37 +0000 (23:17 -0700)]
spec: Go has no 'reference types'

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

12 years agodoc/go1.1.html: additional tweaks
Dave Cheney [Wed, 3 Apr 2013 05:49:17 +0000 (16:49 +1100)]
doc/go1.1.html: additional tweaks

R=r, adg, minux.ma
CC=golang-dev
https://golang.org/cl/8250043

12 years agodoc: add prominent download button to getting started page
Andrew Gerrand [Wed, 3 Apr 2013 04:59:17 +0000 (15:59 +1100)]
doc: add prominent download button to getting started page

Also remove the introduction, which says what the rest of the
page says anyway.

Fixes #5182.

R=golang-dev, kamil.kisiel, r
CC=golang-dev
https://golang.org/cl/8281044

12 years agoruntime: avoid hashing strings until needed in single-bucket maps
Brad Fitzpatrick [Wed, 3 Apr 2013 03:58:25 +0000 (20:58 -0700)]
runtime: avoid hashing strings until needed in single-bucket maps

This changes the map lookup behavior for string maps with 2-8 keys.

There was already previously a fastpath for 0 items and 1 item.

Now, if a string-keyed map has <= 8 items, first check all the
keys for length first. If only one has the right length, then
just check it for equality and avoid hashing altogether. Once
the map has more than 8 items, always hash like normal.

I don't know why some of the other non-string map benchmarks
got faster. This was with benchtime=2s, multiple times. I haven't
anything else getting slower, though.

benchmark                             old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                     37           34   -8.20%
BenchmarkHashInt32Speed                      32           29  -10.67%
BenchmarkHashInt64Speed                      31           27  -12.82%
BenchmarkHashStringArraySpeed               105           99   -5.43%
BenchmarkMegMap                          274206       255153   -6.95%
BenchmarkMegOneMap                           27           23  -14.80%
BenchmarkMegEqMap                        148332       116089  -21.74%
BenchmarkMegEmptyMap                          4            3  -12.72%
BenchmarkSmallStrMap                         22           22   -0.89%
BenchmarkMapStringKeysEight_32               42           23  -43.71%
BenchmarkMapStringKeysEight_64               55           23  -56.96%
BenchmarkMapStringKeysEight_1M           279688           24  -99.99%
BenchmarkIntMap                              16           15  -10.18%
BenchmarkRepeatedLookupStrMapKey32           40           37   -8.15%
BenchmarkRepeatedLookupStrMapKey1M       287918       272980   -5.19%
BenchmarkNewEmptyMap                        156          130  -16.67%

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

12 years agoruntime: new map tests and benchmarks
Brad Fitzpatrick [Wed, 3 Apr 2013 00:55:49 +0000 (17:55 -0700)]
runtime: new map tests and benchmarks

Also, move an existing benchmark from map_test.go to
mapspeed_test.go.

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

12 years agolib/time: update time zone to IANA version 2013b
Rob Pike [Tue, 2 Apr 2013 23:49:45 +0000 (16:49 -0700)]
lib/time: update time zone to IANA version 2013b
Update #4553.

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

12 years agonet/http: fewer allocations in chunkWriter.WriteHeader
Brad Fitzpatrick [Tue, 2 Apr 2013 23:27:23 +0000 (16:27 -0700)]
net/http: fewer allocations in chunkWriter.WriteHeader

It was unnecessarily cloning and then mutating a map that had
a very short lifetime (just that function).

No new tests, because they were added in revision 833bf2ef1527
(TestHeaderToWire). The benchmarks below are from the earlier
commit, revision 52e3407d.

I noticed this inefficiency when reviewing a change Peter Buhr
is looking into, which will also use these benchmarks.

benchmark                         old ns/op    new ns/op    delta
BenchmarkServerHandlerTypeLen         12547        12325   -1.77%
BenchmarkServerHandlerNoLen           12466        11167  -10.42%
BenchmarkServerHandlerNoType          12699        11800   -7.08%
BenchmarkServerHandlerNoHeader        11901         9210  -22.61%

benchmark                        old allocs   new allocs    delta
BenchmarkServerHandlerTypeLen            21           20   -4.76%
BenchmarkServerHandlerNoLen              20           18  -10.00%
BenchmarkServerHandlerNoType             20           18  -10.00%
BenchmarkServerHandlerNoHeader           17           13  -23.53%

benchmark                         old bytes    new bytes    delta
BenchmarkServerHandlerTypeLen          1930         1913   -0.88%
BenchmarkServerHandlerNoLen            1912         1879   -1.73%
BenchmarkServerHandlerNoType           1912         1878   -1.78%
BenchmarkServerHandlerNoHeader         1491         1086  -27.16%

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

12 years agoruntime: Implement faster equals for strings and bytes.
Keith Randall [Tue, 2 Apr 2013 23:26:15 +0000 (16:26 -0700)]
runtime: Implement faster equals for strings and bytes.

(amd64)
benchmark           old ns/op    new ns/op    delta
BenchmarkEqual0            16            6  -63.15%
BenchmarkEqual9            22            7  -65.37%
BenchmarkEqual32           36            9  -74.91%
BenchmarkEqual4K         2187          120  -94.51%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEqual9        392.22      1134.38    2.89x
BenchmarkEqual32       866.72      3457.39    3.99x
BenchmarkEqual4K      1872.73     33998.87   18.15x

(386)
benchmark           old ns/op    new ns/op    delta
BenchmarkEqual0            16            5  -63.85%
BenchmarkEqual9            22            7  -67.84%
BenchmarkEqual32           34           12  -64.94%
BenchmarkEqual4K         2196          113  -94.85%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEqual9        405.81      1260.18    3.11x
BenchmarkEqual32       919.55      2631.21    2.86x
BenchmarkEqual4K      1864.85     36072.54   19.34x

Update #3751

R=bradfitz, r, khr, dave, remyoudompheng, fullung, minux.ma, ality
CC=golang-dev
https://golang.org/cl/8056043

12 years agonet/http: new server Handler benchmarks
Brad Fitzpatrick [Tue, 2 Apr 2013 22:42:06 +0000 (15:42 -0700)]
net/http: new server Handler benchmarks

For all the Content-Type & Content-Length cases.

R=golang-dev, pabuhr
CC=golang-dev
https://golang.org/cl/8280046

12 years agocmd/gc: preserve safe annotation of package def.
David Symonds [Tue, 2 Apr 2013 21:26:08 +0000 (08:26 +1100)]
cmd/gc: preserve safe annotation of package def.

A package file may begin as either "package foo" or
"package foo safe". The latter is relevant when using -u.
https://golang.org/cl/6903059 resulted in the distinction
being dropped when a package was read for the second or later time.
This CL records whether that "safe" tag was present,
and includes it in the dummy statement generated for the lexer.

R=golang-dev, r, minux.ma, daniel.morsing, iant
CC=golang-dev
https://golang.org/cl/8255044

12 years agoruntime: fix a comment regarding default floating point precision
Carl Shapiro [Tue, 2 Apr 2013 20:45:56 +0000 (13:45 -0700)]
runtime: fix a comment regarding default floating point precision

The expected precision setting for the x87 on Win32 is 53-bit
but MinGW resets the floating point unit to 64-bit.  Win32
object code generally expects values to be rounded to double,
not double extended, precision.

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

12 years agonet: delete DialOpt and DialOption; add struct Dialer
Brad Fitzpatrick [Tue, 2 Apr 2013 20:24:16 +0000 (13:24 -0700)]
net: delete DialOpt and DialOption; add struct Dialer

Per discussions on golang-nuts and golang-dev:
"Some concerns with DialOpt"
https://groups.google.com/d/msg/golang-nuts/Hfh9aqhXyUw/W3uYi8lOdKcJ
https://groups.google.com/d/msg/golang-dev/37omSQeWv4Y/KASGIfPpXh0J

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

12 years agocmd/gofmt: handle ... in rewrite of calls
Robert Griesemer [Tue, 2 Apr 2013 20:18:32 +0000 (13:18 -0700)]
cmd/gofmt: handle ... in rewrite of calls

Fixes #5059.

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

12 years agocmd/go: fix typo in docs
Shenghou Ma [Tue, 2 Apr 2013 19:34:04 +0000 (03:34 +0800)]
cmd/go: fix typo in docs
Fixes #5181.

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

12 years agonet/http: remove useless named result arguments in type
Brad Fitzpatrick [Tue, 2 Apr 2013 19:12:16 +0000 (12:12 -0700)]
net/http: remove useless named result arguments in type

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

12 years agocmd/godoc: don't linkify index entries
Robert Griesemer [Tue, 2 Apr 2013 19:05:14 +0000 (12:05 -0700)]
cmd/godoc: don't linkify index entries

Fixes #5186.

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

12 years agosort: be consistent when describing "less: function in the multiKeys example
Rob Pike [Tue, 2 Apr 2013 17:25:02 +0000 (10:25 -0700)]
sort: be consistent when describing "less: function in the multiKeys example
s/ordering/less/g

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

12 years agosort: new example: programmatic sort by multiple keys
Rob Pike [Tue, 2 Apr 2013 16:35:30 +0000 (09:35 -0700)]
sort: new example: programmatic sort by multiple keys
Demonstrates one way to sort a slice of structs according
to different sort criteria, done in sequence.

One possible answer to a question that comes up often.

R=golang-dev, gri, bradfitz, adg, adg, rogpeppe
CC=golang-dev
https://golang.org/cl/8182044

12 years agocompress/gzip: add Writer.Flush to call flate.Writer's Flush
Brad Fitzpatrick [Tue, 2 Apr 2013 16:07:43 +0000 (09:07 -0700)]
compress/gzip: add Writer.Flush to call flate.Writer's Flush

From a discussion on golang-nuts.

R=golang-dev, dsymonds, nigeltao, coocood, adg
CC=golang-dev
https://golang.org/cl/8251043

12 years agocmd/gc: recognize (a.b[0]<<1 | a.b[0]>>31) as a rotate, not just
Nigel Tao [Tue, 2 Apr 2013 10:14:34 +0000 (21:14 +1100)]
cmd/gc: recognize (a.b[0]<<1 | a.b[0]>>31) as a rotate, not just
(x<<1 | x>>31).

Fixes #5084.

On the SHA3 benchmark proposals at
https://golang.org/cl/7760044/

benchmark                       old ns/op    new ns/op    delta
BenchmarkPermutationFunction         1288         1191   -7.53%
BenchmarkSingleByteWrite             5795         5811   +0.28%
BenchmarkBlockWrite512                178          179   +0.56%
BenchmarkBlockWrite384                230          233   +1.30%
BenchmarkBlockWrite256                282          286   +1.42%
BenchmarkBlockWrite224                301          306   +1.66%
BenchmarkBulkHashSHA3_512          326885       304548   -6.83%
BenchmarkBulkHashSHA3_384          234839       220074   -6.29%
BenchmarkBulkHashSHA3_256          186969       175790   -5.98%
BenchmarkBulkHashSHA3_224          178133       167489   -5.98%

For a function like

func g() {
        x = a[3]<<20 | a[3]>>12
}

the asm goes from

0006 (main.go:10) TEXT    g+0(SB),$0-0
0007 (main.go:10) MOVL    a+12(SB),BP
0008 (main.go:10) LOCALS  ,$0
0009 (main.go:11) MOVL    BP,BX
0010 (main.go:11) SHLL    $20,BX
0011 (main.go:11) SHRL    $12,BP
0012 (main.go:11) ORL     BP,BX
0013 (main.go:11) MOVL    BX,x+0(SB)
0014 (main.go:12) RET     ,

to

0006 (main.go:10) TEXT    g+0(SB),$0-0
0007 (main.go:10) LOCALS  ,$0
0008 (main.go:11) MOVL    a+12(SB),BX
0009 (main.go:11) ROLL    $20,BX
0010 (main.go:11) MOVL    BX,x+0(SB)
0011 (main.go:12) RET     ,

R=rsc, iant, remyoudompheng
CC=golang-dev, jcb
https://golang.org/cl/7944043

12 years agodoc/go1.1.html: add a note about additional platforms
Dave Cheney [Tue, 2 Apr 2013 04:08:28 +0000 (15:08 +1100)]
doc/go1.1.html: add a note about additional platforms

Mention support for NetBSD, OpenBSD, and cgo for linux/arm.

R=golang-dev, dvyukov, r, minux.ma, adg, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8152043