]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agocmd/go: test: do not put object files where later steps will find them
Michael Hudson-Doyle [Wed, 8 Jan 2014 04:53:16 +0000 (23:53 -0500)]
cmd/go: test: do not put object files where later steps will find them

When recompiling a package whose basename is the name of a standard
package for testing with gccgo, a .o file with the basename of the
package being tested was being placed in the _test/ directory where the
compilation of the test binary then found it when looking for the
standard library package.

This change puts the object files in a separate directory.

Fixes #6793

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

11 years agoruntime: use special records hung off the MSpan to
Keith Randall [Tue, 7 Jan 2014 21:45:50 +0000 (13:45 -0800)]
runtime: use special records hung off the MSpan to
record finalizers and heap profile info.  Enables
removing the special bit from the heap bitmap.  Also
provides a generic mechanism for annotating occasional
heap objects.

finalizers
        overhead      per obj
old 680 B       80 B avg
new 16 B/span     48 B

profile
        overhead      per obj
old 32KB       24 B + hash tables
new 16 B/span     24 B

R=cshapiro, khr, dvyukov, gobot
CC=golang-codereviews
https://golang.org/cl/13314053

11 years agonet/http: fix data race when sharing request body between client and server
Brad Fitzpatrick [Tue, 7 Jan 2014 18:40:56 +0000 (10:40 -0800)]
net/http: fix data race when sharing request body between client and server

A server Handler (e.g. a proxy) can receive a Request, and
then turn around and give a copy of that Request.Body out to
the Transport. So then two goroutines own that Request.Body
(the server and the http client), and both think they can
close it on failure.  Therefore, all incoming server requests
bodies (always *http.body from transfer.go) need to be
thread-safe.

Fixes #6995

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46570043

11 years agoencoding/csv: test that carriage return is handled in Write
Shawn Smith [Tue, 7 Jan 2014 17:32:15 +0000 (09:32 -0800)]
encoding/csv: test that carriage return is handled in Write

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46310043

11 years agocmd/gc: add missing dupok flag for interface method wrappers.
Rémy Oudompheng [Tue, 7 Jan 2014 17:25:11 +0000 (18:25 +0100)]
cmd/gc: add missing dupok flag for interface method wrappers.

R=rsc
CC=golang-codereviews
https://golang.org/cl/48420044

11 years agocrypto/sha512: avoid duplicate block declaration on 386
Joel Sing [Tue, 7 Jan 2014 12:50:31 +0000 (23:50 +1100)]
crypto/sha512: avoid duplicate block declaration on 386

Unbreak the build - we do not have a sha512 block implementation in
386 assembly (yet).

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/48520043

11 years agocmd/gc: do not omit wrapper for expression (interface{...}).F
Rémy Oudompheng [Tue, 7 Jan 2014 12:26:48 +0000 (13:26 +0100)]
cmd/gc: do not omit wrapper for expression (interface{...}).F

Fixes #6723.

R=rsc
CC=golang-codereviews
https://golang.org/cl/41570047

11 years agocrypto/sha512: block implementation in amd64 assembly
Joel Sing [Tue, 7 Jan 2014 12:16:46 +0000 (23:16 +1100)]
crypto/sha512: block implementation in amd64 assembly

Benchmark on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1779         1114  -37.38%
BenchmarkHash1K             9848         4894  -50.30%
BenchmarkHash8K            68513        32187  -53.02%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.50         7.18    1.60x
BenchmarkHash1K           103.97       209.19    2.01x
BenchmarkHash8K           119.57       254.51    2.13x

R=agl
CC=golang-codereviews
https://golang.org/cl/37150044

11 years agolib9, libmach, cmd/dist, go/build: add support for GOOS=solaris
Aram Hăvărneanu [Tue, 7 Jan 2014 12:12:12 +0000 (23:12 +1100)]
lib9, libmach, cmd/dist, go/build: add support for GOOS=solaris

This change adds solaris to the list of supported operating
systems and allows cmd/dist to be built on Solaris.

This CL has to come first because we want the tools to ignore
solaris-specific files until the whole port is integrated.

R=golang-codereviews, jsing, rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/35900045

11 years agosyscall: include mmap constants in netbsd zerror* files
Joel Sing [Tue, 7 Jan 2014 12:04:17 +0000 (23:04 +1100)]
syscall: include mmap constants in netbsd zerror* files

Include the <sys/mman.h> header for NetBSD mkerrors.sh. This brings
in constants used with mmap(2), msync(2) and mlockall(2).

The regeneration of the NetBSD zerror* files also picks clone(2)
related constants.

Update #4929.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/45510044

11 years agocmd/gc: use 100x less memory for []byte("string")
Russ Cox [Tue, 7 Jan 2014 01:43:44 +0000 (20:43 -0500)]
cmd/gc: use 100x less memory for []byte("string")

[]byte("string") was simplifying to
[]byte{0: 0x73, 1: 0x74, 2: 0x72, 3: 0x69, 4: 0x6e, 5: 0x67},
but that latter form takes up much more memory in the compiler.
Preserve the string form and recognize it to turn global variables
initialized this way into linker-initialized data.

Reduces the compiler memory footprint for a large []byte initialized
this way from approximately 10 kB/B to under 100 B/B.

See also issue 6643.

R=golang-codereviews, r, iant, oleku.konko, dave, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/15930045

11 years agocrypto/rsa: support unpadded signatures.
Adam Langley [Mon, 6 Jan 2014 21:11:58 +0000 (16:11 -0500)]
crypto/rsa: support unpadded signatures.

Usually when a message is signed it's first hashed because RSA has low
limits on the size of messages that it can sign. However, some
protocols sign short messages directly. This isn't a great idea because
the messages that can be signed suddenly depend on the size of the RSA
key, but several people on golang-nuts have requested support for
this and it's very easy to do.

R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44400043

11 years agoundo CL 44150043 / 198bdc0984dd
Brad Fitzpatrick [Mon, 6 Jan 2014 20:38:04 +0000 (12:38 -0800)]
undo CL 44150043 / 198bdc0984dd

See https://golang.org/cl/44150043/

««« original CL description
regexp: use sync.Pool

For machines, not threads.

Update #4720

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

TBR=golang-dev
CC=golang-codereviews
https://golang.org/cl/48190043

11 years agoarchive/zip: fix bug reading zip64 files
Brad Fitzpatrick [Mon, 6 Jan 2014 18:43:56 +0000 (10:43 -0800)]
archive/zip: fix bug reading zip64 files

ZIP64 Extra records are variably sized, but we weren't capping
our reading of the extra fields at its previously-declared
size.

No test because I don't know how to easily create such files
and don't feel like manually construction one.  But all
existing tests pass, and this is "obviously correct" (queue
laughter).

Fixes #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/48150043

11 years agonet/http: Add more call order tests for request form parsing.
Matthew Cottingham [Mon, 6 Jan 2014 18:36:04 +0000 (10:36 -0800)]
net/http: Add more call order tests for request form parsing.

Adds tests for branches handling call ordering which
were shown to be untested by the cover tool.

This is part of the refactoring of form parsing discussed
in CL 44040043. These tests may need to be changed later but
should help lock in the current behaviour.

R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/46750043

11 years agohash/fnv: fix overview link currently returning 404.
Bill Thiede [Mon, 6 Jan 2014 18:34:24 +0000 (10:34 -0800)]
hash/fnv: fix overview link currently returning 404.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47570043

11 years agotime: add tests for Tick, NewTicker with negative duration
Shawn Smith [Mon, 6 Jan 2014 18:32:07 +0000 (10:32 -0800)]
time: add tests for Tick, NewTicker with negative duration

R=golang-codereviews, gobot, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/37660044

11 years agocrypto/sha256: block implementation in 386 assembly
Joel Sing [Mon, 6 Jan 2014 18:31:22 +0000 (13:31 -0500)]
crypto/sha256: block implementation in 386 assembly

Benchmark on Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz (albeit in a VM)

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1606          699  -56.48%
BenchmarkHash1K            21920         7268  -66.84%
BenchmarkHash8K           165696        53756  -67.56%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.98        11.44    2.30x
BenchmarkHash1K            46.72       140.88    3.02x
BenchmarkHash8K            49.44       152.39    3.08x

R=agl, cldorian
CC=golang-codereviews
https://golang.org/cl/44800044

11 years agonet/http: remove todos from cookie code
Volker Dobler [Mon, 6 Jan 2014 18:00:58 +0000 (10:00 -0800)]
net/http: remove todos from cookie code

The Domain and Path field of a parsed cookie have been
the unprocessed wire data since Go 1.0; this seems to
be okay for most applications so let's keep it.

Returning the unprocessed wire data makes it easy to
handle nonstandard or even broken clients without
consulting Raw or Unparsed of a cookie.

The RFC 6265 parsing rules for domain and path are
currently buried in net/http/cookiejar but could be
exposed in net/http if necessary.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/48060043

11 years agonet/http/cookiejar: document format of domain in PublicSuffix
Volker Dobler [Mon, 6 Jan 2014 18:00:20 +0000 (10:00 -0800)]
net/http/cookiejar: document format of domain in PublicSuffix

Document what values a PublicSuffixList must accept as
a domain in a call to PublicSuffix.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/47560044

11 years agoruntime: Fix panic when trying to stop CPU profiling with profiler turned off
Emil Hessman [Mon, 6 Jan 2014 17:53:55 +0000 (09:53 -0800)]
runtime: Fix panic when trying to stop CPU profiling with profiler turned off

Fixes #7063.

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/47950043

11 years agomisc/emacs: fontify type switch correctly
Dominik Honnef [Mon, 6 Jan 2014 16:11:03 +0000 (11:11 -0500)]
misc/emacs: fontify type switch correctly

Require at least one space after "type" and do not fontify closing
parenthesis of type switch as a type.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/37720050

11 years agomisc/emacs: minor cleanups
Dominik Honnef [Mon, 6 Jan 2014 15:48:06 +0000 (10:48 -0500)]
misc/emacs: minor cleanups

R=adonovan
CC=golang-codereviews
https://golang.org/cl/23290044

11 years agocrypto/sha1, crypto/sha256, crypto/sha512: use copy for partial block
Joel Sing [Sun, 5 Jan 2014 14:34:56 +0000 (01:34 +1100)]
crypto/sha1, crypto/sha256, crypto/sha512: use copy for partial block

Use copy rather than a hand rolled loop when moving a partial input
block to the scratch area. This results in a reasonable performance
gain when partial blocks are written.

Benchmarks on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz with Go amd64:

       benchmark               old MB/s     new MB/s  speedup
SHA1   BenchmarkHash8Bytes        18.37        22.80    1.24x
SHA256 BenchmarkHash8Bytes        11.86        13.78    1.16x
SHA512 BenchmarkHash8Bytes         4.51         5.24    1.16x

       benchmark              old ns/op    new ns/op    delta
SHA1   BenchmarkHash8Bytes          435          350  -19.54%
SHA256 BenchmarkHash8Bytes          674          580  -13.95%
SHA512 BenchmarkHash8Bytes         1772         1526  -13.88%

R=agl, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/35840044

11 years agocontainer/list: improve test coverage
Shawn Smith [Sat, 4 Jan 2014 20:48:32 +0000 (07:48 +1100)]
container/list: improve test coverage

R=golang-codereviews, dave, gobot, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/46640043

11 years agoruntime: plan 9 does have /dev/random
Jeff Sickel [Sat, 4 Jan 2014 18:53:22 +0000 (10:53 -0800)]
runtime: plan 9 does have /dev/random

R=golang-codereviews, r, aram
CC=0intro, golang-codereviews, rsc
https://golang.org/cl/43420045

11 years agospec: s/and/or/ for correctness and parallelism
Rob Pike [Sat, 4 Jan 2014 18:52:59 +0000 (10:52 -0800)]
spec: s/and/or/ for correctness and parallelism
No change to the meaning, just bad writing found by
Doug McIlroy.
Let's start the new year off with a bang.

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/47110044

11 years agoruntime: Fix race detector checks to ignore KindNoPointers bit
Keith Randall [Sat, 4 Jan 2014 16:43:17 +0000 (08:43 -0800)]
runtime: Fix race detector checks to ignore KindNoPointers bit
when comparing kinds.

R=dvyukov, dave, khr
CC=golang-codereviews
https://golang.org/cl/41660045

11 years agospec: Fix broken type identity link
Emil Hessman [Sat, 4 Jan 2014 06:48:03 +0000 (22:48 -0800)]
spec: Fix broken type identity link

Fixes #7003.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47780043

11 years agoos: add tests for operations on nil *File methods
Dave Cheney [Fri, 3 Jan 2014 22:58:04 +0000 (09:58 +1100)]
os: add tests for operations on nil *File methods

R=shawn.p.smith, gobot, r
CC=golang-codereviews
https://golang.org/cl/46820043

11 years agoos: return ErrInvalid if receiver is nil.
Dave Cheney [Fri, 3 Jan 2014 21:25:09 +0000 (08:25 +1100)]
os: return ErrInvalid if receiver is nil.

Fixes #7043.

Test coming in https://golang.org/cl/46820043

R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/38330045

11 years agocmd/gc: silence assignment errors to undefined symbols
Daniel Morsing [Fri, 3 Jan 2014 20:03:20 +0000 (21:03 +0100)]
cmd/gc: silence assignment errors to undefined symbols

Fixes #6406.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46900043

11 years agoencoding/json: Fix missing error when trying to unmarshal null string into int, for...
Emil Hessman [Fri, 3 Jan 2014 18:13:28 +0000 (10:13 -0800)]
encoding/json: Fix missing error when trying to unmarshal null string into int, for successive ,string option

Fixes #7046.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47260043

11 years agosyscall: handle varied path lengths for unix sockets
Joel Sing [Fri, 3 Jan 2014 13:29:20 +0000 (00:29 +1100)]
syscall: handle varied path lengths for unix sockets

Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.

Fixes #6627.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/46420044

11 years agoruntime: increase attempt count for map iteration order test.
David Symonds [Thu, 2 Jan 2014 23:41:56 +0000 (10:41 +1100)]
runtime: increase attempt count for map iteration order test.

Some builders broke on this test; I'm guessing that was because
this test didn't try hard enough to find a different iteration order.

Update #6719

R=dave
CC=golang-codereviews
https://golang.org/cl/47300043

11 years agoruntime: add a test for randomised map iteration order.
David Symonds [Thu, 2 Jan 2014 23:10:54 +0000 (10:10 +1100)]
runtime: add a test for randomised map iteration order.

Technically the spec does not guarantee that the iteration order is random,
but it is a property that we have consciously pursued, and so it seems
right to verify that our implementation does indeed randomise.

Update #6719.

R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/47010043

11 years agoA+C: Pavel Zinovkin (individual CLA)
Brad Fitzpatrick [Thu, 2 Jan 2014 19:00:14 +0000 (11:00 -0800)]
A+C: Pavel Zinovkin (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/39780047

11 years agoencoding/hex: add Decode error test case
Shawn Smith [Thu, 2 Jan 2014 18:34:21 +0000 (10:34 -0800)]
encoding/hex: add Decode error test case

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46880043

11 years agotime: add tests for Duration.Nanoseconds, Duration.Minutes, and Duration.Hours
Shawn Smith [Thu, 2 Jan 2014 10:01:18 +0000 (21:01 +1100)]
time: add tests for Duration.Nanoseconds, Duration.Minutes, and Duration.Hours

R=golang-codereviews, rsc, dave
CC=golang-codereviews
https://golang.org/cl/42440043

11 years agoencoding/json: add tests for InvalidUnmarshalError
Dave Cheney [Wed, 1 Jan 2014 22:49:55 +0000 (09:49 +1100)]
encoding/json: add tests for InvalidUnmarshalError

R=golang-codereviews, shawn.p.smith
CC=golang-codereviews
https://golang.org/cl/41960047

11 years agobufio: improve NewReaderSize, Peek, and UnreadByte test coverage
Shawn Smith [Wed, 1 Jan 2014 11:26:22 +0000 (22:26 +1100)]
bufio: improve NewReaderSize, Peek, and UnreadByte test coverage

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/42990045

11 years agoencoding/json: improve omitempty test coverage
Shawn Smith [Wed, 1 Jan 2014 06:54:06 +0000 (17:54 +1100)]
encoding/json: improve omitempty test coverage

R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/46250043

11 years agoos: improve Readdir and Readdirnames test coverage
Shawn Smith [Wed, 1 Jan 2014 05:40:52 +0000 (16:40 +1100)]
os: improve Readdir and Readdirnames test coverage

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46450043

11 years agoencoding/hex: add Decode test case with uppercase hex characters
Shawn Smith [Wed, 1 Jan 2014 05:32:05 +0000 (16:32 +1100)]
encoding/hex: add Decode test case with uppercase hex characters

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46270043

11 years agodebug/elf: add C source for testdata executables
Michael Stapelberg [Tue, 31 Dec 2013 22:36:13 +0000 (14:36 -0800)]
debug/elf: add C source for testdata executables

This source file, when compiled with gcc 4.4.3 on Ubuntu lucid,
corresponds instruction for instruction to the binaries in the same
directory.

Shipping this source code file resolves http://bugs.debian.org/716853

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/46780043

11 years agocrypto/sha256: add tests for Size() and BlockSize()
Shawn Smith [Tue, 31 Dec 2013 20:46:00 +0000 (07:46 +1100)]
crypto/sha256: add tests for Size() and BlockSize()

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46470043

11 years ago2014: Year of the Gopher.
David Symonds [Tue, 31 Dec 2013 13:00:22 +0000 (00:00 +1100)]
2014: Year of the Gopher.

R=adg, djd, mpvl, nigeltao
CC=golang-codereviews
https://golang.org/cl/46660043

11 years agocrypto/sha1: add tests for Size() and BlockSize()
Shawn Smith [Tue, 31 Dec 2013 12:13:05 +0000 (23:13 +1100)]
crypto/sha1: add tests for Size() and BlockSize()

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46400044

11 years agocontainer/ring: add test for Move with empty Ring
Shawn Smith [Tue, 31 Dec 2013 10:18:40 +0000 (21:18 +1100)]
container/ring: add test for Move with empty Ring

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46630044

11 years agonet: fix typo
Mikio Hara [Tue, 31 Dec 2013 09:52:37 +0000 (18:52 +0900)]
net: fix typo

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/46600043

11 years agocrypto/sha512: add tests for Size() and BlockSize()
Shawn Smith [Tue, 31 Dec 2013 08:29:09 +0000 (19:29 +1100)]
crypto/sha512: add tests for Size() and BlockSize()

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/43550047

11 years agotext/template: don't panic when using AddParseTree with an unparsed template
Josh Bleecher Snyder [Tue, 31 Dec 2013 01:17:19 +0000 (17:17 -0800)]
text/template: don't panic when using AddParseTree with an unparsed template

Fixes #7032.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/43960045

11 years agospec: example shows wrong value for complex constant
Mihai Borobocea [Mon, 30 Dec 2013 21:29:56 +0000 (13:29 -0800)]
spec: example shows wrong value for complex constant

Looks like a typo.
Fixes #7011.

R=golang-codereviews, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/45350043

11 years agoA+C: Mihai Borobocea (individual CLA)
Brad Fitzpatrick [Mon, 30 Dec 2013 21:29:38 +0000 (13:29 -0800)]
A+C: Mihai Borobocea (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/46540044

11 years agocmd/6g: inline copies of up to 4 words in length.
Keith Randall [Mon, 30 Dec 2013 20:14:27 +0000 (12:14 -0800)]
cmd/6g: inline copies of up to 4 words in length.

This change fixes a serious performance regression
with reflect.Value growing to 4 words instead of 3.
The json benchmark was ~50% slower, with this change
it is ~5% slower (and the binary is 0.5% larger).

Longer term, we probably need to rethink our copy
generation.  Using REP is really expensive time-wise.
But inlining the copy grows the binary.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/44990043

11 years agoruntime: use readrange instead of read to check for races
Keith Randall [Mon, 30 Dec 2013 20:03:56 +0000 (12:03 -0800)]
runtime: use readrange instead of read to check for races
on map keys and values which are now passed by reference.

R=dvyukov, khr
CC=golang-codereviews
https://golang.org/cl/43490044

11 years agoreflect: fixed method name in Slice3 error message
Richard Musiol [Mon, 30 Dec 2013 19:41:01 +0000 (11:41 -0800)]
reflect: fixed method name in Slice3 error message

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46500043

11 years agoreflect: add DeepEqual slice of slice inequality test
Shawn Smith [Mon, 30 Dec 2013 19:39:47 +0000 (11:39 -0800)]
reflect: add DeepEqual slice of slice inequality test

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46510043

11 years agodoc/contribute: golang-dev -> golang-codereviews
Shawn Smith [Sun, 29 Dec 2013 19:11:28 +0000 (11:11 -0800)]
doc/contribute: golang-dev -> golang-codereviews

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/46320043

11 years agoreflect: remove length check for arrays in deepValueEqual
Shawn Smith [Sun, 29 Dec 2013 19:05:30 +0000 (11:05 -0800)]
reflect: remove length check for arrays in deepValueEqual

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/39910044

11 years agoio: add tests for SectionReader ReadAt and Size
Shawn Smith [Sun, 29 Dec 2013 11:38:05 +0000 (22:38 +1100)]
io: add tests for SectionReader ReadAt and Size

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/39200045

11 years agocrypto/hmac: add tests for Size() and BlockSize()
Shawn Smith [Sun, 29 Dec 2013 09:56:05 +0000 (20:56 +1100)]
crypto/hmac: add tests for Size() and BlockSize()

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/41320044

11 years agoruntime: load runtime.goarm as a byte, not a word
Dave Cheney [Sun, 29 Dec 2013 04:25:34 +0000 (15:25 +1100)]
runtime: load runtime.goarm as a byte, not a word

Fixes #6952.

runtime.asminit was incorrectly loading runtime.goarm as a word, not a uint8 which made it subject to alignment issues on arm5 platforms.

Alignment aside, this also meant that the top 3 bytes in R11 would have been garbage and could not be assumed to be setting up the FPU reliably.

R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/46240043

11 years agonet: work around Solaris connect issue when server closes socket
Ian Lance Taylor [Sat, 28 Dec 2013 17:37:54 +0000 (09:37 -0800)]
net: work around Solaris connect issue when server closes socket

On Solaris, if you do a in-progress connect, and then the
server accepts and closes the socket, the client's later
attempt to complete the connect will fail with EINVAL.  Handle
this case by assuming that the connect succeeded.  This code
is weird enough that it is implemented as Solaris-only so that
it doesn't hide a real error on a different OS.

Update #6828

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/46160043

11 years agobytes: add test for Contains
Shawn Smith [Sat, 28 Dec 2013 09:33:05 +0000 (20:33 +1100)]
bytes: add test for Contains

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46140043

11 years agoarchive/tar: add test case for passing nil to FileInfoHeader
Shawn Smith [Sat, 28 Dec 2013 05:14:49 +0000 (16:14 +1100)]
archive/tar: add test case for passing nil to FileInfoHeader

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/44710044

11 years agoall: fix a few spelling errors in source comments
Martin Olsson [Fri, 27 Dec 2013 16:59:02 +0000 (08:59 -0800)]
all: fix a few spelling errors in source comments

R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/45750044

11 years agoA+C: Martin Olsson (individual CLA)
Ian Lance Taylor [Fri, 27 Dec 2013 16:53:34 +0000 (08:53 -0800)]
A+C: Martin Olsson (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/46040043

11 years agonet: use DialTimeout in TestSelfConnect
Ian Lance Taylor [Fri, 27 Dec 2013 16:49:47 +0000 (08:49 -0800)]
net: use DialTimeout in TestSelfConnect

This avoids problems with systems that take a long time to
find out nothing is listening, while still testing for the
self-connect misfeature since a self-connect should be fast.
With this we may be able to remove the test for non-Linux
systems.

Tested (on GNU/Linux) by editing selfConnect in
tcpsock_posix.go to always return false and verifying that
TestSelfConnect then fails with and without this change.

Idea from Uros Bizjak.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/39200044

11 years agostrconv: add tests for FormatBool and AppendBool
Shawn Smith [Fri, 27 Dec 2013 16:40:14 +0000 (08:40 -0800)]
strconv: add tests for FormatBool and AppendBool

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/42480043

11 years agostrconv: remove unused atof32int function
Shawn Smith [Fri, 27 Dec 2013 16:40:03 +0000 (08:40 -0800)]
strconv: remove unused atof32int function

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/44200044

11 years agocrypto/cipher: remove unused shift1 function
Shawn Smith [Fri, 27 Dec 2013 16:39:54 +0000 (08:39 -0800)]
crypto/cipher: remove unused shift1 function

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/38990045

11 years agonet/http: quiet distracting test spam
Brad Fitzpatrick [Thu, 26 Dec 2013 21:03:30 +0000 (13:03 -0800)]
net/http: quiet distracting test spam

Capture log output (and test it while at it),
and quiet unnecessary t.Logf.

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/45850043

11 years agonet/http: fix data race in benchmark
Brad Fitzpatrick [Thu, 26 Dec 2013 20:16:11 +0000 (12:16 -0800)]
net/http: fix data race in benchmark

Fixes #7006

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/44940044

11 years agonet/http: Release reference to chunkWriter's bufio.Writer on hijack
John Newlin [Thu, 26 Dec 2013 19:52:14 +0000 (11:52 -0800)]
net/http: Release reference to chunkWriter's bufio.Writer on hijack

When a connection is hijacked, release the reference to the bufio.Writer
that is used with the chunkWriter.  The chunkWriter is not used after
the connection is hijacked.

Also add a test to check that double Hijack calls do something sensible.

benchmark                old ns/op    new ns/op    delta
BenchmarkServerHijack        24137        20629  -14.53%

benchmark               old allocs   new allocs    delta
BenchmarkServerHijack           21           19   -9.52%

benchmark                old bytes    new bytes    delta
BenchmarkServerHijack        11774         9667  -17.90%

R=bradfitz, dave, chris.cahoon
CC=golang-codereviews
https://golang.org/cl/39440044

11 years agoC: add John Newlin (Google CLA)
Brad Fitzpatrick [Thu, 26 Dec 2013 19:52:04 +0000 (11:52 -0800)]
C: add John Newlin (Google CLA)

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/45830043

11 years agodatabase/sql: Use all connections in pool
Marko Tiikkaja [Thu, 26 Dec 2013 19:27:18 +0000 (11:27 -0800)]
database/sql: Use all connections in pool

The last connection in the pool was not being handed out correctly.

R=golang-codereviews, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/40410043

11 years agoruntime/cgo: include <signal.h> to fix build
Ian Lance Taylor [Tue, 24 Dec 2013 16:24:32 +0000 (08:24 -0800)]
runtime/cgo: include <signal.h> to fix build

R=golang-codereviews
TBR=dfc
CC=golang-codereviews
https://golang.org/cl/43120044

11 years agoruntime/cgo: always set signal mask before calling pthread_create
Ian Lance Taylor [Tue, 24 Dec 2013 16:08:15 +0000 (08:08 -0800)]
runtime/cgo: always set signal mask before calling pthread_create

This was done correctly for most targets but was missing from
FreeBSD/ARM and Linux/ARM.

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/45180043

11 years agomisc/vim: Fix broken quote
Yasuhiro Matsumoto [Mon, 23 Dec 2013 21:40:13 +0000 (08:40 +1100)]
misc/vim: Fix broken quote

R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/44960043

11 years agocgo/runtime: replace sigprocmask with pthread_sigmask.
S.Çağlar Onur [Sun, 22 Dec 2013 16:55:29 +0000 (08:55 -0800)]
cgo/runtime: replace sigprocmask with pthread_sigmask.

sigprocmask use in a multithreaded environment is undefined so replace it with pthread_sigmask.

Fixes #6811.

R=jsing, iant
CC=golang-codereviews, golang-dev
https://golang.org/cl/30460043

11 years agoA+C: S.Çağlar Onur (individual CLA)
Ian Lance Taylor [Sun, 22 Dec 2013 16:50:56 +0000 (08:50 -0800)]
A+C: S.Çağlar Onur (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/42800045

11 years agobytes, strings: improve Title test coverage by adding cases with underscore and unico...
Shawn Smith [Sat, 21 Dec 2013 07:19:32 +0000 (23:19 -0800)]
bytes, strings: improve Title test coverage by adding cases with underscore and unicode line separator

R=golang-codereviews, gobot, r
CC=golang-codereviews
https://golang.org/cl/42310045

11 years agodoc/go1.3.txt: mention windows syscall.NewCallbackCDecl
Alex Brainman [Sat, 21 Dec 2013 01:52:53 +0000 (12:52 +1100)]
doc/go1.3.txt: mention windows syscall.NewCallbackCDecl

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/44160044

11 years agoos: reimplement HasPrefix and LastIndex to not depend on strings
David du Colombier [Sat, 21 Dec 2013 00:22:10 +0000 (01:22 +0100)]
os: reimplement HasPrefix and LastIndex to not depend on strings

R=golang-codereviews, rsc
CC=golang-codereviews, jas
https://golang.org/cl/44790043

11 years agocmd/gc: do not compute dead value maps if they will not be used
Russ Cox [Sat, 21 Dec 2013 00:14:42 +0000 (19:14 -0500)]
cmd/gc: do not compute dead value maps if they will not be used

Reduces 6g big.go memory usage from 251 MB to 242 MB.
Reduces 6g slow.go memory usage from 529 MB to 453 MB.

Mostly a memory savings; 6g slow.go is only about 5% faster.

The test programs are at
https://rsc.googlecode.com/hg/testdata/big.go (36k lines, 276kB)
https://rsc.googlecode.com/hg/testdata/slow.go (7k lines, 352kB)

R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/42280045

11 years agonet/http: empty contenty-type treated as application/octet-stream
Jakub Ryszard Czarnowicz [Fri, 20 Dec 2013 19:49:42 +0000 (11:49 -0800)]
net/http: empty contenty-type treated as application/octet-stream

RFC 2616, section 7.2.1 - empty type SHOULD be treated as
application/octet-stream.
Fixes #6616.

R=golang-codereviews, gobot, bradfitz, josharian
CC=golang-codereviews
https://golang.org/cl/31810043

11 years agocmd/gc: address 1½ liveness bottlenecks
Russ Cox [Fri, 20 Dec 2013 19:24:48 +0000 (14:24 -0500)]
cmd/gc: address 1½ liveness bottlenecks

As much as 7x speedup on some programs, cuts all.bash time by 20%.

Change splicebefore function from O(n) to O(1).
The approach was suggested by Carl during the code's review
but apparently did not make it into the tree.
It makes a huge difference on huge programs.

Make twobitwalktype1 slightly faster by using & instead of %.
Really it needs to be cached; left a note to that effect.
(Not a complete fix, hence the ½.)

big.go (output of test/chan/select5.go)
 47.53u   0.50s  48.14r before this CL
  7.09u   0.47s   7.59r with splicebefore change (6.7x speedup)
  6.15u   0.42s   6.59r with twobitwalktype1 change (1.15x speedup; total 7.7x)

slow.go (variant of program in go.text, by mpvl)
 77.75u   2.11s  80.03r before this CL
 24.40u   1.97s  26.44r with splicebefore change (3.2x speedup)
 18.12u   2.19s  20.38r with twobitwalktype1 change (1.35x speedup; total 4.3x)

test/run
150.63u  49.57s  81.08r before this CL
 88.01u  45.60s  46.65r after this CL (1.7x speedup)

all.bash
369.70u 115.64s 256.21r before this CL
298.52u 110.35s 214.67r after this CL (1.24x speedup)

The test programs are at
https://rsc.googlecode.com/hg/testdata/big.go (36k lines, 276kB)
https://rsc.googlecode.com/hg/testdata/slow.go (7k lines, 352kB)

R=golang-codereviews, gobot, r
CC=cshapiro, golang-codereviews
https://golang.org/cl/43210045

11 years agocmd/gc: bypass DATA instruction for data initialized to integer constant
Russ Cox [Fri, 20 Dec 2013 19:24:39 +0000 (14:24 -0500)]
cmd/gc: bypass DATA instruction for data initialized to integer constant

Eventually we will want to bypass DATA for everything,
but the relocations are not standardized well enough across
architectures to make that possible.

This did not help as much as I expected, but it is definitely better.
It shaves maybe 1-2% off all.bash depending on how much you
trust the timings of a single run:

Before: 241.139r 362.702u 112.967s
After:  234.339r 359.623u 111.045s

R=golang-codereviews, gobot, r, iant
CC=golang-codereviews
https://golang.org/cl/44650043

11 years agosync: explain Pool's intentions
Rob Pike [Fri, 20 Dec 2013 19:15:50 +0000 (11:15 -0800)]
sync: explain Pool's intentions
Expand the type's doc comment to make its purpose clear
and discourage misuse.

R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/44680043

11 years agoA+C: Jakub Ryszard Czarnowicz (individual CLA)
Brad Fitzpatrick [Fri, 20 Dec 2013 18:11:11 +0000 (10:11 -0800)]
A+C: Jakub Ryszard Czarnowicz (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/44690043

11 years agodoc: fix typo in Effective Go
Josh Bleecher Snyder [Fri, 20 Dec 2013 17:59:51 +0000 (09:59 -0800)]
doc: fix typo in Effective Go

R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/44430043

11 years agoio/ioutil: use sync.Pool in Discard
Brad Fitzpatrick [Fri, 20 Dec 2013 17:38:35 +0000 (09:38 -0800)]
io/ioutil: use sync.Pool in Discard

And merge the blackhole.go file back into ioutil,
where it once was. It was only in a separate file
because it used to have race-vs-!race versions.

R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44060044

11 years agolibmach: remove old object file readers
Russ Cox [Fri, 20 Dec 2013 17:10:53 +0000 (12:10 -0500)]
libmach: remove old object file readers

These no longer work; removing them makes other refactoring easier.
The code for pack P being deleted in this CL does not work either.
I created issue 6989 to track restoring this functionality (probably not
until pack is written in Go).

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/44300043

11 years agocrypto/tls: rework reference tests.
Adam Langley [Fri, 20 Dec 2013 16:37:05 +0000 (11:37 -0500)]
crypto/tls: rework reference tests.

The practice of storing reference connections for testing has worked
reasonably well, but the large blocks of literal data in the .go files
is ugly and updating the tests is a real problem because their number
has grown.

This CL changes the way that reference tests work. It's now possible to
automatically update the tests and the test data is now stored in
testdata/. This should make it easier to implement changes that affect
all connections, like implementing the renegotiation extension.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/42060044

11 years agocodereview: switch defaultcc to golang-codereviews
Russ Cox [Fri, 20 Dec 2013 15:53:50 +0000 (10:53 -0500)]
codereview: switch defaultcc to golang-codereviews

See this thread for background:
https://groups.google.com/forum/#!topic/golang-dev/xG7vPi21r8g

R=golang-codereviews, gobot, golang-dev, dsymonds
CC=golang-codereviews, golang-dev
https://golang.org/cl/44450043

11 years agonet: ParseIP should return nil if :: doesn't expand in an IPv6 address.
Alex A Skinner [Fri, 20 Dec 2013 12:29:28 +0000 (21:29 +0900)]
net: ParseIP should return nil if :: doesn't expand in an IPv6 address.

Per RFC 4291, 'The use of "::" indicates one or more groups of 16 bits of zeros.'
Fixes #6628

R=golang-dev, rsc, minux.ma, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/15990043

11 years agoruntime: fix build for OpenBSD
Shenghou Ma [Fri, 20 Dec 2013 02:12:18 +0000 (21:12 -0500)]
runtime: fix build for OpenBSD

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

11 years agoruntime: unblock signals when we try to core dump
Shenghou Ma [Fri, 20 Dec 2013 01:45:05 +0000 (20:45 -0500)]
runtime: unblock signals when we try to core dump
Fixes #6988.

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

11 years agoreflect: rewrite Value to separate out pointer vs. nonpointer info.
Keith Randall [Thu, 19 Dec 2013 23:15:24 +0000 (15:15 -0800)]
reflect: rewrite Value to separate out pointer vs. nonpointer info.
Needed for precise gc and copying stacks.

reflect.Value now takes 4 words instead of 3.

Still to do:
 - un-iword-ify channel ops.
 - un-iword-ify method receivers.

R=golang-dev, iant, rsc, khr
CC=golang-dev
https://golang.org/cl/43040043