]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

11 years agoliblink: allow either of a pair of conflicting symbols to say dupok
Russ Cox [Thu, 19 Dec 2013 21:52:47 +0000 (16:52 -0500)]
liblink: allow either of a pair of conflicting symbols to say dupok

This makes the linker's -X flag work again.

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

11 years agonet/http: add Hihack benchmark
Brad Fitzpatrick [Thu, 19 Dec 2013 21:24:42 +0000 (13:24 -0800)]
net/http: add Hihack benchmark

Notably, to show allocs. Currently: 11766 B/op, 21 allocs/op,
at least one alloc of which is in the benchmark loop itself.

R=golang-dev, jnewlin
CC=golang-dev
https://golang.org/cl/40370057

11 years agoruntime: reduce delays in finalizer test.
Rémy Oudompheng [Thu, 19 Dec 2013 20:37:44 +0000 (21:37 +0100)]
runtime: reduce delays in finalizer test.

The runtime tests are executed 4 times in all.bash
and there is currently a 5-second delay each time.

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

11 years agoos: rename only works as part of the same directory on Plan 9
David du Colombier [Thu, 19 Dec 2013 20:20:03 +0000 (21:20 +0100)]
os: rename only works as part of the same directory on Plan 9

R=golang-dev, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/44080046

11 years agogo/build: mention 'tag' as an alias for 'build constraint'
Rob Pike [Thu, 19 Dec 2013 19:43:34 +0000 (11:43 -0800)]
go/build: mention 'tag' as an alias for 'build constraint'
The code is all about tags, and the cmd/go documentation
said to look in the go/build documentation for information
about tags, but the documentation said nothing about tags,
only build constraints. Make things clearer.

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

11 years agocrypto/x509: import crypto/sha256
Adam Langley [Thu, 19 Dec 2013 19:06:28 +0000 (14:06 -0500)]
crypto/x509: import crypto/sha256

Since SHA-256 is now the default hash function, x509 should import it
otherwise some programs may fail because it hasn't been linked in.

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

11 years agocmd/yacc: expr example support windows
ChaiShushan [Thu, 19 Dec 2013 17:14:07 +0000 (12:14 -0500)]
cmd/yacc: expr example support windows

1. expr append executable extension.
2. support '\r' character.

Fixes #6851.

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

11 years agocmd/ld: make hostobj work on newer openbsd
Joel Sing [Thu, 19 Dec 2013 16:58:27 +0000 (03:58 +1100)]
cmd/ld: make hostobj work on newer openbsd

Make hostobj work on OpenBSD 5.3/5.4/-current - these have PIE
enabled by default and linking fails since the Go linker generates
objects that are neither PIC nor PIE.

Fixes #5067

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

11 years agonet: rename TestReadConfig to TestDNSReadConfig
Mikio Hara [Thu, 19 Dec 2013 04:02:06 +0000 (13:02 +0900)]
net: rename TestReadConfig to TestDNSReadConfig

To make it possible to type "go test -run=DNS".
Also removes unnecessary parens.

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

11 years agosyscall: add NewCallbackCDecl again
Alex Brainman [Thu, 19 Dec 2013 03:38:50 +0000 (14:38 +1100)]
syscall: add NewCallbackCDecl again

Fixes #6338

R=golang-dev, kin.wilson.za, rsc
CC=golang-dev
https://golang.org/cl/36180044

11 years agoruntime/pprof: skip tests that fail on windows-amd64-race builder
Alex Brainman [Thu, 19 Dec 2013 03:15:57 +0000 (14:15 +1100)]
runtime/pprof: skip tests that fail on windows-amd64-race builder

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

11 years agocompress/flate: use io.ByteReader in docs
Brad Fitzpatrick [Thu, 19 Dec 2013 02:24:55 +0000 (18:24 -0800)]
compress/flate: use io.ByteReader in docs

We did this elsewhere when io.ByteReader was added
but forgot this one.

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

11 years agoruntime: mark objects in free lists as allocated and unscannable.
Keith Randall [Thu, 19 Dec 2013 01:13:59 +0000 (17:13 -0800)]
runtime: mark objects in free lists as allocated and unscannable.

On the plus side, we don't need to change the bits when mallocing
pointerless objects.  On the other hand, we need to mark objects in the
free lists during GC.  But the free lists are small at GC time, so it
should be a net win.

benchmark                    old ns/op    new ns/op    delta
BenchmarkMalloc8                    40           33  -17.65%
BenchmarkMalloc16                   45           38  -15.72%
BenchmarkMallocTypeInfo8            58           59   +0.85%
BenchmarkMallocTypeInfo16           63           64   +1.10%

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

11 years agonet: don't return a nested error when happy eyeballs dialing
Mikio Hara [Thu, 19 Dec 2013 01:00:15 +0000 (10:00 +0900)]
net: don't return a nested error when happy eyeballs dialing

Also removes an unused variable.

Fixes #6795.

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

11 years agoregexp: use sync.Pool
Brad Fitzpatrick [Thu, 19 Dec 2013 00:43:19 +0000 (16:43 -0800)]
regexp: use sync.Pool

For machines, not threads.

Update #4720

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

11 years agoliblink: use explicit field for globl duplicate detection
Russ Cox [Thu, 19 Dec 2013 00:36:14 +0000 (19:36 -0500)]
liblink: use explicit field for globl duplicate detection

Overloading size leads to problems if clients
try to set up an LSym by hand.

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

11 years agodebug/goobj: expand package prefix correctly
Russ Cox [Thu, 19 Dec 2013 00:00:52 +0000 (19:00 -0500)]
debug/goobj: expand package prefix correctly

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

11 years agosyscall: disallow slashes in file names on Plan 9
David du Colombier [Wed, 18 Dec 2013 23:58:23 +0000 (00:58 +0100)]
syscall: disallow slashes in file names on Plan 9

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

11 years agonet/http: use sync.Pool
Brad Fitzpatrick [Wed, 18 Dec 2013 23:52:20 +0000 (15:52 -0800)]
net/http: use sync.Pool

Update #4720

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

11 years agoencoding/json: use sync.Pool
Brad Fitzpatrick [Wed, 18 Dec 2013 23:52:05 +0000 (15:52 -0800)]
encoding/json: use sync.Pool

Benchmark is within the noise. I had to run this a dozen times
each before & after (on wall power, without a browser running)
before I could get halfway consistent numbers, and even then
they jumped all over the place, with the new one sometimes
being better. But these are the best of a dozen each.

Slowdown is expected anyway, since I imagine channels are
optimized more.

benchmark                 old ns/op    new ns/op    delta
BenchmarkCodeEncoder       26556987     27291072   +2.76%
BenchmarkEncoderEncode         1069         1071   +0.19%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkCodeEncoder          73.07        71.10    0.97x

benchmark                old allocs   new allocs    delta
BenchmarkEncoderEncode            2            2    0.00%

benchmark                 old bytes    new bytes    delta
BenchmarkEncoderEncode          221          221    0.00%

Update #4720

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

11 years agoliblink, cmd/gc: resolve several shift warnings
Dave Cheney [Wed, 18 Dec 2013 23:34:33 +0000 (10:34 +1100)]
liblink, cmd/gc: resolve several shift warnings

Address several warnings generated by clang -fsanitize=undefined

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

11 years agocmd/go: show testflag help for "go test -h"
Shenghou Ma [Wed, 18 Dec 2013 22:40:31 +0000 (17:40 -0500)]
cmd/go: show testflag help for "go test -h"
Fixes #6576.

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

11 years agonet: add test cases for the both of netgo, cgo DNS lookups
Mikio Hara [Wed, 18 Dec 2013 22:40:10 +0000 (07:40 +0900)]
net: add test cases for the both of netgo, cgo DNS lookups

Update #4078

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

11 years agoencoding/asn1: Fix parsing of non-printable strings in
Jakob Borg [Wed, 18 Dec 2013 22:06:17 +0000 (17:06 -0500)]
encoding/asn1: Fix parsing of non-printable strings in
sequences.

Use the same criteria for when to modify the tag type when
parsing a string in a sequence as when parsing a bare string
field.

Fixes #6726.

R=golang-dev, bradfitz, gobot, agl
CC=golang-dev
https://golang.org/cl/22460043

11 years agomath/rand: Float32/64 must only return values in [0,1)
Jeff R. Allen [Wed, 18 Dec 2013 20:38:53 +0000 (15:38 -0500)]
math/rand: Float32/64 must only return values in [0,1)

Float32 and Float64 are now both created by taking the ratio
of two integers which are chosen to fit entirely into the
precision of the desired float type. The previous code
could cast a Float64 with more than 23 bits of ".99999"
into a Float32 of 1.0, which is not in [0,1).

Float32 went from 15 to 21 ns/op (but is now correct).

Fixes #6721.

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

11 years agocmd/yacc: gofmt y.go
ChaiShushan [Wed, 18 Dec 2013 20:17:08 +0000 (15:17 -0500)]
cmd/yacc: gofmt y.go

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

11 years agoimage/gif: respect local color table transparency.
Nigel Tao [Wed, 18 Dec 2013 20:10:40 +0000 (15:10 -0500)]
image/gif: respect local color table transparency.

Fixes #6441.

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

11 years agocmd/6g, cmd/gc, cmd/ld: fix Plan 9 amd64 warnings
David du Colombier [Wed, 18 Dec 2013 19:20:46 +0000 (20:20 +0100)]
cmd/6g, cmd/gc, cmd/ld: fix Plan 9 amd64 warnings

warning: src/cmd/6g/reg.c:671 format mismatch d VLONG, arg 4
warning: src/cmd/gc/pgen.c:230 set and not used: oldstksize
warning: src/cmd/gc/plive.c:877 format mismatch lx UVLONG, arg 2
warning: src/cmd/gc/walk.c:2878 set and not used: cbv
warning: src/cmd/gc/walk.c:2885 set and not used: hbv
warning: src/cmd/ld/data.c:198 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/data.c:230 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/dwarf.c:1517 set and not used: pc
warning: src/cmd/ld/elf.c:1507 format mismatch d VLONG, arg 2
warning: src/cmd/ld/ldmacho.c:509 set and not used: dsymtab

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

11 years agolibmach, cmd/8l: fix Plan 9 warnings
David du Colombier [Wed, 18 Dec 2013 19:19:59 +0000 (20:19 +0100)]
libmach, cmd/8l: fix Plan 9 warnings

warning: src/libmach/sym.c:1861 non-interruptable temporary
warning: src/cmd/8l/../ld/pcln.c:29 set and not used: p

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

11 years agoliblink: fix Plan 9 warnings
David du Colombier [Wed, 18 Dec 2013 19:19:29 +0000 (20:19 +0100)]
liblink: fix Plan 9 warnings

warning: src/liblink/asm5.c:485 non-interruptable temporary
warning: src/liblink/asm5.c:565 set and not used: c
warning: src/liblink/asm5.c:622 format mismatch ux VLONG, arg 2
warning: src/liblink/asm5.c:1218 overspecified class: asmout GLOBL STATIC
warning: src/liblink/asm5.c:2088 overspecified class: oprrr GLOBL STATIC
warning: src/liblink/asm5.c:2202 overspecified class: opbra GLOBL STATIC
warning: src/liblink/asm5.c:2237 overspecified class: olr GLOBL STATIC
warning: src/liblink/asm5.c:2266 overspecified class: olhr GLOBL STATIC
warning: src/liblink/asm5.c:2291 overspecified class: osr GLOBL STATIC
warning: src/liblink/asm5.c:2302 overspecified class: oshr GLOBL STATIC
warning: src/liblink/asm5.c:2312 overspecified class: osrr GLOBL STATIC
warning: src/liblink/asm5.c:2319 overspecified class: oshrr GLOBL STATIC
warning: src/liblink/asm5.c:2325 overspecified class: olrr GLOBL STATIC
warning: src/liblink/asm5.c:2332 overspecified class: olhrr GLOBL STATIC
warning: src/liblink/asm5.c:2338 overspecified class: ofsr GLOBL STATIC
warning: src/liblink/asm5.c:2375 overspecified class: omvl GLOBL STATIC
warning: src/liblink/asm8.c:1261 format mismatch d VLONG, arg 3
warning: src/liblink/asm8.c:1274 format mismatch +d VLONG, arg 5
warning: src/liblink/list5.c:153 format mismatch d VLONG, arg 3
warning: src/liblink/list5.c:310 format mismatch d VLONG, arg 3
warning: src/liblink/obj6.c:665 set and not used: q
warning: src/liblink/pcln.c:32 set and not used: p

R=golang-dev, jas, gobot, rsc
CC=golang-dev
https://golang.org/cl/40370043

11 years agofmt: use sync.Pool
Brad Fitzpatrick [Wed, 18 Dec 2013 19:09:07 +0000 (11:09 -0800)]
fmt: use sync.Pool

Update #4720

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

11 years agosync: add Pool type
Brad Fitzpatrick [Wed, 18 Dec 2013 19:08:34 +0000 (11:08 -0800)]
sync: add Pool type

Adds the Pool type and docs, and use it in fmt.
This is a temporary implementation, until Dmitry
makes it fast.

Uses the API proposal from Russ in http://goo.gl/cCKeb2 but
adds an optional New field, as used in fmt and elsewhere.
Almost all callers want that.

Update #4720

R=golang-dev, rsc, cshapiro, iant, r, dvyukov, khr
CC=golang-dev
https://golang.org/cl/41860043

11 years agoapi: update next.txt
Brad Fitzpatrick [Wed, 18 Dec 2013 18:37:27 +0000 (10:37 -0800)]
api: update next.txt

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

11 years agoliblink: don't search for an import file with an absolute path
Ian Lance Taylor [Wed, 18 Dec 2013 18:33:47 +0000 (10:33 -0800)]
liblink: don't search for an import file with an absolute path

This restores the old behaviour, and makes it possible to
continue to use 6g and 6l directly, rather than the go tool,
with dot imports.

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

11 years agocmd/nm: minor cleanup from previous CL
Russ Cox [Wed, 18 Dec 2013 18:29:40 +0000 (13:29 -0500)]
cmd/nm: minor cleanup from previous CL

I forgot to apply Ian's suggestions before submitting CL 40600043.

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

11 years agoencoding/csv: remove unused unreadRune function
Shawn Smith [Wed, 18 Dec 2013 18:29:27 +0000 (13:29 -0500)]
encoding/csv: remove unused unreadRune function

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

11 years agohtml: add tests for UnescapeString edge cases
Shawn Smith [Wed, 18 Dec 2013 18:20:25 +0000 (10:20 -0800)]
html: add tests for UnescapeString edge cases

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

11 years agoencoding/asn1: add more test cases for BitString.At and TestUTCTime, add test for...
Shawn Smith [Wed, 18 Dec 2013 18:19:07 +0000 (10:19 -0800)]
encoding/asn1: add more test cases for BitString.At and TestUTCTime, add test for ObjectIdentifier.Equal

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

11 years agoencoding/json: add test for HTMLEscape
Shawn Smith [Wed, 18 Dec 2013 18:18:35 +0000 (10:18 -0800)]
encoding/json: add test for HTMLEscape

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

11 years agomisc/notepadplus: Fix Function List in Notepad++ 6.5
ChaiShushan [Wed, 18 Dec 2013 18:17:38 +0000 (10:17 -0800)]
misc/notepadplus: Fix Function List in Notepad++ 6.5

Since version 6.5, npp change the Function List syntax for User Defined Languages.
We need use userDefinedLangName syntax in association tag in Notepad++ 6.5.

Fix issue 6735.

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

11 years agogo/ast: added example illustrating CommentMap use.
Robert Griesemer [Wed, 18 Dec 2013 18:10:40 +0000 (10:10 -0800)]
go/ast: added example illustrating CommentMap use.

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

11 years agoencoding/ascii85: add empty string case for Encode test
Shawn Smith [Wed, 18 Dec 2013 16:33:59 +0000 (08:33 -0800)]
encoding/ascii85: add empty string case for Encode test

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

11 years agonet: test dnsconfig_unix with sample resolv.conf
Anfernee Yongkun Gui [Wed, 18 Dec 2013 16:26:36 +0000 (08:26 -0800)]
net: test dnsconfig_unix with sample resolv.conf

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

11 years agocrypto/x509: set default signature hash to SHA256 and allow override.
Adam Langley [Wed, 18 Dec 2013 15:57:56 +0000 (10:57 -0500)]
crypto/x509: set default signature hash to SHA256 and allow override.

Previously the hash used when signing an X.509 certificate was fixed
and, for RSA, it was fixed to SHA1. Since Microsoft have announced the
deprecation of SHA1 in X.509 certificates, this change switches the
default to SHA256.

It also allows the hash function to be controlled by the caller by
setting the SignatureAlgorithm field of the template.

[1] http://blogs.technet.com/b/pki/archive/2013/11/12/sha1-deprecation-policy.aspx

Fixes #5302.

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

11 years agocrypto/x509: add non-cgo darwin system anchor certs
Josh Bleecher Snyder [Wed, 18 Dec 2013 15:57:07 +0000 (10:57 -0500)]
crypto/x509: add non-cgo darwin system anchor certs

The set of certs fetched via exec'ing `security` is not quite identical
to the certs fetched via the cgo call. The cgo fetch includes
any trusted root certs that the user may have added; exec does not.
The exec fetch includes an Apple-specific root cert; the cgo fetch
does not. Other than that, they appear to be the same.

Unfortunately, os/exec depends on crypto/x509, via net/http. Break the
circular dependency by moving the exec tests to their own package.

This will not work in iOS; we'll cross that bridge when we get to it.

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

11 years agoencoding/json: speed up decoding
Brad Fitzpatrick [Wed, 18 Dec 2013 15:30:21 +0000 (07:30 -0800)]
encoding/json: speed up decoding

Don't make copies of keys while decoding, and don't use the
expensive strings.EqualFold when it's not necessary. Instead,
note in the existing field cache what algorithm to use to
check fold equality... most keys are just ASCII letters.

benchmark               old ns/op    new ns/op    delta
BenchmarkCodeDecoder    137074314    103974418  -24.15%

benchmark                old MB/s     new MB/s  speedup
BenchmarkCodeDecoder        14.16        18.66    1.32x

Update #6496

R=golang-dev, rsc, adg, r, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13894045

11 years agoA+C: Anfernee Yongkun Gui (individual CLA)
Brad Fitzpatrick [Wed, 18 Dec 2013 12:06:56 +0000 (04:06 -0800)]
A+C: Anfernee Yongkun Gui (individual CLA)

Generated by addca.

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

11 years agolog: fix example (fix build)
Andrew Gerrand [Wed, 18 Dec 2013 06:25:23 +0000 (17:25 +1100)]
log: fix example (fix build)

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

11 years agolog: add example
ChaiShushan [Wed, 18 Dec 2013 05:24:11 +0000 (16:24 +1100)]
log: add example

Fixes #6028.

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

11 years agoA+C: Nicolas Antonius Ernst Leopold Maria Kaiser (individual CLA)
Andrew Gerrand [Wed, 18 Dec 2013 04:48:05 +0000 (15:48 +1100)]
A+C: Nicolas Antonius Ernst Leopold Maria Kaiser (individual CLA)

Generated by addca.

R=gobot, nikai
CC=golang-dev
https://golang.org/cl/43620043

11 years agoflag: remove unused FlagSet.exitOnError field
ChaiShushan [Wed, 18 Dec 2013 04:18:12 +0000 (23:18 -0500)]
flag: remove unused FlagSet.exitOnError field

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

11 years agonet: make TestDNSThreadLimit execute at the end of tests
Mikio Hara [Wed, 18 Dec 2013 04:05:47 +0000 (13:05 +0900)]
net: make TestDNSThreadLimit execute at the end of tests

Because TestDNSThreadLimit consumes tons of file descriptors and
makes other tests flaky when CGO_ENABLE=0 or being with netgo tag.

Fixes #6580.

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

11 years agoliblink: rewrite '\\' in paths to '/' on windows
Shenghou Ma [Wed, 18 Dec 2013 03:40:13 +0000 (22:40 -0500)]
liblink: rewrite '\\' in paths to '/' on windows
At least three Go tests rely on that (log, runtime/{pprof,debug}).

Fixes #6972.
Fixes #6974.
Fixes #6975.

R=alex.brainman, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/43150043

11 years agoruntime: skip broken TestRuntimeGogoBytes on windows
Alex Brainman [Wed, 18 Dec 2013 03:17:47 +0000 (14:17 +1100)]
runtime: skip broken TestRuntimeGogoBytes on windows

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

11 years agocmd/go: avoid use of 'go tool pack'
Russ Cox [Wed, 18 Dec 2013 02:44:36 +0000 (21:44 -0500)]
cmd/go: avoid use of 'go tool pack'

All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.

These changes make it possible to rewrite cmd/pack in Go.

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

11 years agocmd/dist: avoid use of 'go tool pack'
Russ Cox [Wed, 18 Dec 2013 02:44:18 +0000 (21:44 -0500)]
cmd/dist: avoid use of 'go tool pack'

All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.

These changes make it possible to rewrite cmd/pack in Go.

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

11 years agocmd/gc: implement -pack flag
Russ Cox [Wed, 18 Dec 2013 02:43:33 +0000 (21:43 -0500)]
cmd/gc: implement -pack flag

The -pack flag causes 5g, 6g, 8g to write a Go archive directly,
instead of requiring the use of 'go tool pack' to convert the .5/.6/.8
to .a format.

Writing directly avoids the copy and also avoids having the
export data stored twice in the archive (once in __.PKGDEF,
once in .5/.6/.8).

A separate CL will enable the use of this flag by cmd/go.

Other build systems that do not know about -pack will be unaffected.

The changes to cmd/ld handle a minor simplification to the format:
an unused section is removed.

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

11 years agoruntime, gc: call interface conversion routines by reference.
Keith Randall [Wed, 18 Dec 2013 00:55:06 +0000 (16:55 -0800)]
runtime, gc: call interface conversion routines by reference.

Part of getting rid of vararg C calls.

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

11 years agonet: rewrite toLower more clearly
David du Colombier [Wed, 18 Dec 2013 00:32:27 +0000 (16:32 -0800)]
net: rewrite toLower more clearly

Rob suggested this change.

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

11 years agoruntime: don't store evacuate bit as low bit of hashtable overflow pointer.
Keith Randall [Tue, 17 Dec 2013 23:23:31 +0000 (15:23 -0800)]
runtime: don't store evacuate bit as low bit of hashtable overflow pointer.

Hash tables currently store an evacuated bit in the low bit
of the overflow pointer.  That's probably not sustainable in the
long term as GC wants correctly typed & aligned pointers.  It is
also a pain to move any of this code to Go in the current state.

This change moves the evacuated bit into the tophash entries.

Performance change is negligable.

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

11 years agodatabase/sql: Fix inaccurate comment
Marko Tiikkaja [Tue, 17 Dec 2013 22:53:31 +0000 (14:53 -0800)]
database/sql: Fix inaccurate comment

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

11 years agoreflect: Add tests for Call with functions taking and returning structs.
Michael Hudson-Doyle [Tue, 17 Dec 2013 22:49:51 +0000 (14:49 -0800)]
reflect: Add tests for Call with functions taking and returning structs.

gccgo has problems using reflect.Call with functions that take and
return structs with no members.  Prior to fixing that problem there, I
thought it sensible to add some tests of this situation.

Update #6761

First contribution to Go, apologies in advance if I'm doing it wrong.

R=golang-dev, dave, minux.ma, iant, khr, bradfitz
CC=golang-dev
https://golang.org/cl/26570046

11 years agoC+A: add Michael Hudson (Linaro CLA)
Brad Fitzpatrick [Tue, 17 Dec 2013 22:49:07 +0000 (14:49 -0800)]
C+A: add Michael Hudson (Linaro CLA)

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

11 years agocontainer/list: Add missing period to doc comment for Front
Caleb Spare [Tue, 17 Dec 2013 22:21:11 +0000 (14:21 -0800)]
container/list: Add missing period to doc comment for Front

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

11 years agonet: reimplement toLower to not depend on strings
David du Colombier [Tue, 17 Dec 2013 22:19:11 +0000 (14:19 -0800)]
net: reimplement toLower to not depend on strings

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

11 years agoruntime: don't crash in SetFinalizer if sizeof *x is zero
Brad Fitzpatrick [Tue, 17 Dec 2013 22:18:58 +0000 (14:18 -0800)]
runtime: don't crash in SetFinalizer if sizeof *x is zero

And document it explicitly, even though it already said
it wasn't guaranteed.

Fixes #6857

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

11 years agodatabase/sql: fix typo in comment
Arne Hormann [Tue, 17 Dec 2013 21:17:43 +0000 (08:17 +1100)]
database/sql: fix typo in comment

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

11 years agoA+C: Arne Hormann (individual CLA)
Andrew Gerrand [Tue, 17 Dec 2013 21:17:17 +0000 (08:17 +1100)]
A+C: Arne Hormann (individual CLA)

Generated by addca.

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

11 years agoos: avoid a string concat in readdir
Brad Fitzpatrick [Tue, 17 Dec 2013 20:25:32 +0000 (12:25 -0800)]
os: avoid a string concat in readdir

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/37690045

11 years agoos, path/filepath: don't ignore Lstat errors in Readdir
Brad Fitzpatrick [Tue, 17 Dec 2013 20:19:01 +0000 (12:19 -0800)]
os, path/filepath: don't ignore Lstat errors in Readdir

os: don't ignore LStat errors in Readdir. If it's ENOENT,
on the second pass, just treat it as missing. If it's another
error, it's real.

path/filepath: use ReaddirNames instead of Readdir in Walk,
in order to obey the documented WalkFunc contract of returning
each walked item's LStat error, if any.

Fixes #6656
Fixes #6680

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

11 years agodatabase/sql: fix auto-reconnect in prepared statements
Julien Schmidt [Tue, 17 Dec 2013 19:57:30 +0000 (11:57 -0800)]
database/sql: fix auto-reconnect in prepared statements

This also fixes several connection leaks.
Fixes #5718

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

11 years agoimage: roll back 13239051 (add RGB and RGB48)
Rob Pike [Tue, 17 Dec 2013 18:49:45 +0000 (10:49 -0800)]
image: roll back 13239051 (add RGB and RGB48)

They cause too much bloat in the internals as we find ourselves adding
special case code for all the cross-connections. It's better to use RGBA
and just max out the alpha. We lose a little memory but reduce the number
of special cases the encoders, decoders, and drawers need to provide.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/42910045

11 years agold: fix Plan 9 build
David du Colombier [Tue, 17 Dec 2013 16:46:07 +0000 (08:46 -0800)]
ld: fix Plan 9 build

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