]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/go: make package list order predicable
Shenghou Ma [Sat, 20 Oct 2012 09:25:13 +0000 (17:25 +0800)]
cmd/go: make package list order predicable
also add a cleanup phase to cmd/go/test.bash.

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

12 years agocodereview: protect against read-only upstream repository
Shenghou Ma [Sat, 20 Oct 2012 09:23:48 +0000 (17:23 +0800)]
codereview: protect against read-only upstream repository

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

12 years agoruntime: ~3.7x speed up of div/mod on ARM
Shenghou Ma [Sat, 20 Oct 2012 08:40:19 +0000 (16:40 +0800)]
runtime: ~3.7x speed up of div/mod on ARM
benchmark                      old ns/op    new ns/op    delta
BenchmarkUint32Div7                  281           75  -73.06%
BenchmarkUint32Div37                 281           75  -73.02%
BenchmarkUint32Div123                281           75  -73.02%
BenchmarkUint32Div763                280           75  -72.89%
BenchmarkUint32Div1247               280           75  -72.93%
BenchmarkUint32Div9305               281           75  -73.02%
BenchmarkUint32Div13307              281           75  -73.06%
BenchmarkUint32Div52513              281           75  -72.99%
BenchmarkUint32Div60978747           281           63  -77.33%
BenchmarkUint32Div106956295          280           63  -77.21%
BenchmarkUint32Mod7                  280           77  -72.21%
BenchmarkUint32Mod37                 280           77  -72.18%
BenchmarkUint32Mod123                280           77  -72.25%
BenchmarkUint32Mod763                280           77  -72.18%
BenchmarkUint32Mod1247               280           77  -72.21%
BenchmarkUint32Mod9305               280           77  -72.21%
BenchmarkUint32Mod13307              280           77  -72.25%
BenchmarkUint32Mod52513              280           77  -72.18%
BenchmarkUint32Mod60978747           280           63  -77.25%
BenchmarkUint32Mod106956295          280           63  -77.21%

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

12 years agobufio: remove a little unnecessary indirection in tests.
Nigel Tao [Sat, 20 Oct 2012 02:02:29 +0000 (13:02 +1100)]
bufio: remove a little unnecessary indirection in tests.

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

12 years agogo spec: constant divisors must not be zero
Robert Griesemer [Fri, 19 Oct 2012 17:12:09 +0000 (10:12 -0700)]
go spec: constant divisors must not be zero

Both gc and gccgo always checked this for constant
expressions but the spec only mentions run-time
exceptions.

This CL also requires that constant divisors
must not be zero in non-constant integer expressions:
This is consistent with the spirit of the most
recent changes and it is consistent with constant
expressions. We don't want to specify the effect for
non-integer expressions (f/0.0 where f is a float or
complex number) because there the result f/g is not
further specified if a non-constant g is 0.

R=r, rsc, iant, ken, andybalholm, iant
CC=golang-dev
https://golang.org/cl/6710045

12 years agogo spec: define make() restrictions as for index expressions
Robert Griesemer [Fri, 19 Oct 2012 17:11:06 +0000 (10:11 -0700)]
go spec: define make() restrictions as for index expressions

This is a language change: Until now, the spec required run-
time panics for some of these errors. Note that gc and gccgo
implemented this inconsistently, and that both compilers already
reported compile-time errors in some cases. This change makes
make() behave along the same vein as index expressions.

This addresses the spec aspect of issue 4085.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6725053

12 years agounsafe: fix a typo
Oling Cat [Fri, 19 Oct 2012 05:35:15 +0000 (16:35 +1100)]
unsafe: fix a typo

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

12 years agobufio: make Writer.ReadFrom not flush prematurely. For example,
Nigel Tao [Fri, 19 Oct 2012 05:32:00 +0000 (16:32 +1100)]
bufio: make Writer.ReadFrom not flush prematurely. For example,
many small writes to a network may be less efficient that a few
large writes.

This fixes net/http's TestClientWrites, broken by 6565056 that
introduced Writer.ReadFrom. That test implicitly assumed that
calling io.Copy on a *bufio.Writer wouldn't write to the
underlying network until the buffer was full.

R=dsymonds
CC=bradfitz, golang-dev, mchaten, mikioh.mikioh
https://golang.org/cl/6743044

12 years agobufio: Implement io.ReaderFrom for (*Writer).
Michael Chaten [Fri, 19 Oct 2012 00:22:51 +0000 (11:22 +1100)]
bufio: Implement io.ReaderFrom for (*Writer).

This is part 2 of 2 for issue 4028.

benchmark                        old ns/op    new ns/op    delta
BenchmarkWriterCopyOptimal           53293        28326  -46.85%
BenchmarkWriterCopyUnoptimal         53757        30537  -43.19%
BenchmarkWriterCopyNoReadFrom        53192        36642  -31.11%

Fixes #4028.

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

12 years agoruntime: update comment for the "extern register" variables g and m.
Nigel Tao [Fri, 19 Oct 2012 00:02:32 +0000 (11:02 +1100)]
runtime: update comment for the "extern register" variables g and m.

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

12 years agoimage/draw: fast-path for 4:4:0 chroma subsampled sources.
Nigel Tao [Thu, 18 Oct 2012 23:55:41 +0000 (10:55 +1100)]
image/draw: fast-path for 4:4:0 chroma subsampled sources.

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

12 years agoencoding/xml: correctly escape newline, carriage return, and tab
Ian Lance Taylor [Thu, 18 Oct 2012 20:40:45 +0000 (13:40 -0700)]
encoding/xml: correctly escape newline, carriage return, and tab

The generated encodings are those from
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping

The change to the decoder ensures that we turn 
 in the
input into \r, not \n.

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

12 years agoimage/jpeg: make TestDCT faster.
Rémy Oudompheng [Thu, 18 Oct 2012 19:28:04 +0000 (21:28 +0200)]
image/jpeg: make TestDCT faster.

The value of cosines are cached in a global array
instead of being recomputed each time.
The test was terribly slow on arm.

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

12 years agonet: add LookupNS(domain string)
Stephen McQuay [Thu, 18 Oct 2012 06:39:04 +0000 (15:39 +0900)]
net: add LookupNS(domain string)
Fixes #4224.

R=golang-dev, dave, minux.ma, mikioh.mikioh, alex.brainman, rsc, herbert.fischer
CC=golang-dev
https://golang.org/cl/6675043

12 years agoA+C: Stephen McQuay (Individual CLA)
Mikio Hara [Thu, 18 Oct 2012 06:37:53 +0000 (15:37 +0900)]
A+C: Stephen McQuay (Individual CLA)

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

12 years agoexp/html: update package docs and add an example; a node's children is
Nigel Tao [Wed, 17 Oct 2012 23:25:50 +0000 (10:25 +1100)]
exp/html: update package docs and add an example; a node's children is
a linked list, not a slice.

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

12 years agodoc/codewalk/markov: fix the highlight range of the step "The NewChain constructor...
Oling Cat [Wed, 17 Oct 2012 21:12:44 +0000 (08:12 +1100)]
doc/codewalk/markov: fix the highlight range of the step "The NewChain constructor function".

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

12 years agocmd/gc: don't squash complex literals when inlining.
Rémy Oudompheng [Wed, 17 Oct 2012 18:33:44 +0000 (20:33 +0200)]
cmd/gc: don't squash complex literals when inlining.

Since this patch changes the way complex literals are written
in export data, there are a few other glitches.

Fixes #4159.

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

12 years agocrypto/cipher: panic on invalid IV length
Shane Hansen [Wed, 17 Oct 2012 18:29:00 +0000 (14:29 -0400)]
crypto/cipher: panic on invalid IV length

Give better user feedback when invalid IV is used
to construct a cipher.

Fixes #3411

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6652053

12 years agoA+C: add Shane Hansen (Individual CLA)
Adam Langley [Wed, 17 Oct 2012 18:21:58 +0000 (14:21 -0400)]
A+C: add Shane Hansen (Individual CLA)

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

12 years agogo spec: restrictions for index and slice expressions
Robert Griesemer [Wed, 17 Oct 2012 18:08:42 +0000 (11:08 -0700)]
go spec: restrictions for index and slice expressions

At the moment, gc and gccgo report compile-
time errors for certain constant indexes that
are out of bounds. The spec however requests
a run-time panic for out-of-bounds indexes
(http://tip.golang.org/ref/spec#Indexes).

Document the status quo.

Fixes #4231.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6699048

12 years agocmd/go: Dedup package arguments before building.
Daniel Morsing [Wed, 17 Oct 2012 15:23:47 +0000 (17:23 +0200)]
cmd/go: Dedup package arguments before building.

Fixes #4104.

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

12 years agomath/big: add 4-bit, fixed window exponentiation.
Adam Langley [Wed, 17 Oct 2012 15:19:26 +0000 (11:19 -0400)]
math/big: add 4-bit, fixed window exponentiation.

A 4-bit window is convenient because 4 divides both 32 and 64,
therefore we never have a window spanning words of the exponent.
Additionaly, the benefit of a 5-bit window is only 2.6% at 1024-bits
and 3.3% at 2048-bits.

This code is still not constant time, however.

benchmark                        old ns/op    new ns/op    delta
BenchmarkRSA2048Decrypt           17108590     11180370  -34.65%
Benchmark3PrimeRSA2048Decrypt     13003720      7680390  -40.94%

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

12 years agosync/atomic: FreeBSD/ARM support
Shenghou Ma [Wed, 17 Oct 2012 06:27:58 +0000 (14:27 +0800)]
sync/atomic: FreeBSD/ARM support
only supports ARMv6K and newer ARM cores.

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

12 years agopath/filepath: better documentation for WalkFunc
Rob Pike [Wed, 17 Oct 2012 05:00:09 +0000 (16:00 +1100)]
path/filepath: better documentation for WalkFunc
Define the properties of the arguments better. In particular,
explain that the path is (sort of) relative to the argument to
Walk.

Fixes #4119.

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

12 years agonet: return error from pollster rather than panicing
Dave Cheney [Tue, 16 Oct 2012 22:41:00 +0000 (09:41 +1100)]
net: return error from pollster rather than panicing

Fixes #3590.

R=bradfitz, mikioh.mikioh, iant, bsiegert
CC=golang-dev
https://golang.org/cl/6684054

12 years agomath/big: fix big.Exp and document better
Robert Griesemer [Tue, 16 Oct 2012 20:46:27 +0000 (13:46 -0700)]
math/big: fix big.Exp and document better

- always return 1 for y <= 0
- document that the sign of m is ignored
- protect against div-0 panics by treating
  m == 0 the same way as m == nil
- added extra tests

Fixes #4239.

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

12 years agocrypto/tls: make closeNotify a warning alert.
Adam Langley [Tue, 16 Oct 2012 19:40:37 +0000 (15:40 -0400)]
crypto/tls: make closeNotify a warning alert.

The RFC doesn't actually have an opinion on whether this is a fatal or
warning level alert, but common practice suggests that it should be a
warning.

This involves rebasing most of the tests.

Fixes #3413.

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

12 years agoexp/types/staging: index and slice type checks
Robert Griesemer [Tue, 16 Oct 2012 17:20:03 +0000 (10:20 -0700)]
exp/types/staging: index and slice type checks

Also: handle assignments to the blank identifier.

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

12 years agoruntime: fix spurious deadlock crashes
Dmitriy Vyukov [Tue, 16 Oct 2012 10:41:32 +0000 (14:41 +0400)]
runtime: fix spurious deadlock crashes
Fixes #4243.

R=golang-dev, iant
CC=golang-dev, sebastien.paolacci
https://golang.org/cl/6682050

12 years agodoc: NetBSD is fully supported now
Shenghou Ma [Tue, 16 Oct 2012 08:02:56 +0000 (16:02 +0800)]
doc: NetBSD is fully supported now

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

12 years agomisc/dist: support packaging for NetBSD
Shenghou Ma [Tue, 16 Oct 2012 07:53:17 +0000 (15:53 +0800)]
misc/dist: support packaging for NetBSD

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

12 years agodoc/godoc.js: put focus on div#page when necessary
Shenghou Ma [Tue, 16 Oct 2012 06:28:18 +0000 (14:28 +0800)]
doc/godoc.js: put focus on div#page when necessary
so that keyboard navigation events are sent to div#page.

        Fixes #4233.

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

12 years agocmd/5g, cmd/6g, cmd/8g: fix out of registers.
Rémy Oudompheng [Tue, 16 Oct 2012 05:22:33 +0000 (07:22 +0200)]
cmd/5g, cmd/6g, cmd/8g: fix out of registers.

This patch is enough to fix compilation of
exp/types tests but only passes a stripped down
version of the appripriate torture test.

Update #4207.

R=dave, nigeltao, rsc, golang-dev
CC=golang-dev
https://golang.org/cl/6621061

12 years agopprof: filter out runtime.settype and fix --svg mode to produce valid XML
Brad Fitzpatrick [Tue, 16 Oct 2012 03:49:15 +0000 (20:49 -0700)]
pprof: filter out runtime.settype and fix --svg mode to produce valid XML

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

12 years agobuilder: label the race builder as "race"
Brad Fitzpatrick [Tue, 16 Oct 2012 03:30:41 +0000 (20:30 -0700)]
builder: label the race builder as "race"

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

12 years agospec: more clarification about deferred functions
Rob Pike [Tue, 16 Oct 2012 00:27:20 +0000 (11:27 +1100)]
spec: more clarification about deferred functions
Proposed new text to make matters clearer. The existing text was
unclear about the state of result parameters when panicking.

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

12 years agoruntime: add missing if(raceenabled)
Dmitriy Vyukov [Mon, 15 Oct 2012 09:54:31 +0000 (13:54 +0400)]
runtime: add missing if(raceenabled)

R=0xe2.0x9a.0x9b, minux.ma, iant, dave
CC=golang-dev
https://golang.org/cl/6654052

12 years agoimage/jpeg: re-organize the processSOS code.
Nigel Tao [Mon, 15 Oct 2012 02:28:30 +0000 (13:28 +1100)]
image/jpeg: re-organize the processSOS code.

This is a straight copy/paste, and the deletion of a TODO. There are
no other changes.

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

12 years agoimage/jpeg: decode progressive JPEGs.
Nigel Tao [Mon, 15 Oct 2012 00:21:20 +0000 (11:21 +1100)]
image/jpeg: decode progressive JPEGs.

To be clear, this supports decoding the bytes on the wire into an
in-memory image. There is no API change: jpeg.Decode will still not
return until the entire image is decoded.

The code is obviously more complicated, and costs around 10% in
performance on baseline JPEGs. The processSOS code could be cleaned up a
bit, and maybe some of that loss can be reclaimed, but I'll leave that
for follow-up CLs, to keep the diff for this one as small as possible.

Before:
BenchmarkDecode     1000    2855637 ns/op   21.64 MB/s
After:
BenchmarkDecodeBaseline      500    3178960 ns/op   19.44 MB/s
BenchmarkDecodeProgressive      500    4082640 ns/op   15.14 MB/s

Fixes #3976.

The test data was generated by:
# Create intermediate files; cjpeg on Ubuntu 10.04 can't read PNG.
convert video-001.png video-001.bmp
convert video-005.gray.png video-005.gray.pgm
# Create new test files.
cjpeg -quality 100 -sample 1x1,1x1,1x1 -progressive video-001.bmp > video-001.progressive.jpeg
cjpeg -quality 50 -sample 2x2,1x1,1x1 video-001.bmp > video-001.q50.420.jpeg
cjpeg -quality 50 -sample 2x1,1x1,1x1 video-001.bmp > video-001.q50.422.jpeg
cjpeg -quality 50 -sample 1x1,1x1,1x1 video-001.bmp > video-001.q50.444.jpeg
cjpeg -quality 50 -sample 2x2,1x1,1x1 -progressive video-001.bmp > video-001.q50.420.progressive.jpeg
cjpeg -quality 50 -sample 2x1,1x1,1x1 -progressive video-001.bmp > video-001.q50.422.progressive.jpeg
cjpeg -quality 50 -sample 1x1,1x1,1x1 -progressive video-001.bmp > video-001.q50.444.progressive.jpeg
cjpeg -quality 50 video-005.gray.pgm > video-005.gray.q50.jpeg
cjpeg -quality 50 -progressive video-005.gray.pgm > video-005.gray.q50.progressive.jpeg
# Delete intermediate files.
rm video-001.bmp video-005.gray.pgm

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

12 years agotime: accept numbers larger than 2^32 in ParseDuration.
David Symonds [Sun, 14 Oct 2012 20:50:13 +0000 (07:50 +1100)]
time: accept numbers larger than 2^32 in ParseDuration.

Fixes #3374.

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

12 years agoio/ioutil: use pathname instead of name in docs to avoid confusion
Shenghou Ma [Sat, 13 Oct 2012 11:05:22 +0000 (19:05 +0800)]
io/ioutil: use pathname instead of name in docs to avoid confusion
caller of ioutil.TempFile() can use f.Name() to get "pathname"
of the temporary file, instead of just the "name" of the file.

Also remove an out-of-date comment about random number state.

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

12 years agocompress/bzip2: use io.ByteReader instead of internal interface
Anthony Martin [Fri, 12 Oct 2012 21:09:24 +0000 (14:09 -0700)]
compress/bzip2: use io.ByteReader instead of internal interface

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

12 years agoruntime: FreeBSD/ARM support
Shenghou Ma [Fri, 12 Oct 2012 15:19:39 +0000 (23:19 +0800)]
runtime: FreeBSD/ARM support

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

12 years agodoc: remove ExpressivenessOfGo.pdf
Shenghou Ma [Fri, 12 Oct 2012 10:50:41 +0000 (18:50 +0800)]
doc: remove ExpressivenessOfGo.pdf
        It has been moved to go.talks/2010/ExpressivenessOfGo-2010.pdf
        URL: http://talks.golang.org/2010/ExpressivenessOfGo-2010.pdf

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

12 years agosyscall: FreeBSD/ARM support
Shenghou Ma [Fri, 12 Oct 2012 08:26:42 +0000 (16:26 +0800)]
syscall: FreeBSD/ARM support

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

12 years agocmd/5l: reorder some struct fields to reduce memory consumption
Shenghou Ma [Fri, 12 Oct 2012 05:39:12 +0000 (13:39 +0800)]
cmd/5l: reorder some struct fields to reduce memory consumption
Valgrind Massif result when linking godoc:
On amd64:
                    old          new         -/+
mem_heap_B       185844612    175358047    -5.7%
mem_heap_extra_B    773404       773137    -0.0%

On 386/ARM:
                    old          new         -/+
mem_heap_B       141775701    131289941    -7.4%
mem_heap_extra_B    737011       736955    -0.0%

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

12 years agocmd/dist: fix superfluous and confusing "binaries ... to be copied or moved" message
Shenghou Ma [Fri, 12 Oct 2012 05:35:05 +0000 (13:35 +0800)]
cmd/dist: fix superfluous and confusing "binaries ... to be copied or moved" message
Also, to aid debugging cmd/dist, make make.bat support --dist-tool flag.

Fixes #3100.

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

12 years agofmt: document some undocumented details
Rob Pike [Fri, 12 Oct 2012 05:16:55 +0000 (16:16 +1100)]
fmt: document some undocumented details
Better explanation of width for floating-point values.
Explain that scanning does not handle %#q etc.

Fixes #4202.
Fixes #4206.

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

12 years agobytes, strings: add (*Reader).WriteTo
Evan Shaw [Fri, 12 Oct 2012 03:43:50 +0000 (14:43 +1100)]
bytes, strings: add (*Reader).WriteTo

Fixes #4031.

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

12 years agotime: delete erroneous word from documentation.
Rob Pike [Fri, 12 Oct 2012 00:00:00 +0000 (11:00 +1100)]
time: delete erroneous word from documentation.
Fixes #4236.

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

12 years agoos/signal: add Notify example
Andrew Gerrand [Thu, 11 Oct 2012 23:22:13 +0000 (10:22 +1100)]
os/signal: add Notify example

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

12 years agomath/big: more conservative use of lock for divisor table
Robert Griesemer [Thu, 11 Oct 2012 23:04:03 +0000 (16:04 -0700)]
math/big: more conservative use of lock for divisor table

Minor performance impact running sequentially:

benchmark                      old ns/op    new ns/op    delta
BenchmarkString10Base2               389          391   +0.51%
BenchmarkString100Base2             1530         1534   +0.26%
BenchmarkString1000Base2           11789        11787   -0.02%
BenchmarkString10000Base2         111443       112030   +0.53%
BenchmarkString100000Base2       1017483      1015347   -0.21%
BenchmarkString10Base8               339          344   +1.47%
BenchmarkString100Base8              753          756   +0.40%
BenchmarkString1000Base8            4618         4641   +0.50%
BenchmarkString10000Base8          43217        43534   +0.73%
BenchmarkString100000Base8        397518       400602   +0.78%
BenchmarkString10Base10              630          630   +0.00%
BenchmarkString100Base10            1975         1960   -0.76%
BenchmarkString1000Base10          10179        10174   -0.05%
BenchmarkString10000Base10         44527        44416   -0.25%
BenchmarkString100000Base10     14404694     14425308   +0.14%
BenchmarkString10Base16              283          288   +1.77%
BenchmarkString100Base16             597          598   +0.17%
BenchmarkString1000Base16           3189         3186   -0.09%
BenchmarkString10000Base16         29403        29364   -0.13%
BenchmarkString100000Base16       265657       265587   -0.03%

Note that due to other improvements (faster assembly routines,
better code generation by compiler), these benchmarks now run
up to 37% faster than they used to at the last time measured (1/9/2012).

Minor performance impact for StringPiParallel running in parallel:

Current CL but with Lock/Unlock commented out (removed):

BenchmarkStringPiParallel     5000     343581 ns/op
BenchmarkStringPiParallel-2    10000     184511 ns/op
BenchmarkStringPiParallel-3    10000     129768 ns/op
BenchmarkStringPiParallel-4    10000     102326 ns/op

Current CL:

BenchmarkStringPiParallel     5000     345169 ns/op
BenchmarkStringPiParallel-2    10000     185827 ns/op
BenchmarkStringPiParallel-3    10000     131168 ns/op
BenchmarkStringPiParallel-4    10000     102353 ns/op

Fixes #4218.

R=dvyukov, michael.jones, dave
CC=golang-dev
https://golang.org/cl/6643053

12 years agocrypto/rsa: fix decryption benchmark.
Adam Langley [Thu, 11 Oct 2012 22:25:23 +0000 (18:25 -0400)]
crypto/rsa: fix decryption benchmark.

I was an idiot and was thinking that a small base didn't matter
because the exponentiation would quickly make the number the same size
as the modulus. But, of course, the small base continues to make
multiplications unrealistically cheap throughout the computation.

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

12 years agonet/http: fix data race on countReader.n
Dave Cheney [Thu, 11 Oct 2012 22:17:56 +0000 (09:17 +1100)]
net/http: fix data race on countReader.n

Fixes #4220.

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

12 years agonet/http: fix race on bodyEOFSignal.isClosed
Dave Cheney [Thu, 11 Oct 2012 21:32:56 +0000 (08:32 +1100)]
net/http: fix race on bodyEOFSignal.isClosed

Update #4191.

Fixes unreported race failure at
http://build.golang.org/log/61e43a328fb220801d3d5c88cd91916cfc5dc43c

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

12 years agocrypto/hmac: add Equal function.
Adam Langley [Thu, 11 Oct 2012 19:28:02 +0000 (15:28 -0400)]
crypto/hmac: add Equal function.

It was suggested that it's too easy to use crypto/hmac insecurely and
I think that has some merit. This change adds a Equal function to
make it obvious that MAC values should be compared in constant time.

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

12 years agodoc/contribute.html: assorted fixes
Shenghou Ma [Thu, 11 Oct 2012 15:33:57 +0000 (23:33 +0800)]
doc/contribute.html: assorted fixes
0. windows uses all.bat instead of ./all.bash
1. correct expected all.bash output
2. mention you need to use an application specific password
if you're using 2-step verification
3. note you can edit files included in CL by 'hg change NNNN'
or 'hg file'

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

12 years agogodoc: update favicon
Andrew Gerrand [Thu, 11 Oct 2012 06:02:36 +0000 (17:02 +1100)]
godoc: update favicon

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

12 years agodoc/faq: discuss virtual memory use by go processes
Andrew Gerrand [Thu, 11 Oct 2012 03:21:19 +0000 (14:21 +1100)]
doc/faq: discuss virtual memory use by go processes

Fixes #3948.

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

12 years ago doc/articles/wiki: numerous fixes
Jimmy Zelinskie [Thu, 11 Oct 2012 02:07:34 +0000 (13:07 +1100)]
  doc/articles/wiki: numerous fixes

Fixes #3733
Fixes #2149
Updated Syntax
Added part3.go example program
Added part3-errorhandling.go example program
Improved wording in some places

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

12 years agoA+C: add Jimmy Zelinskie (Individual CLA)
Andrew Gerrand [Thu, 11 Oct 2012 00:20:01 +0000 (11:20 +1100)]
A+C: add Jimmy Zelinskie (Individual CLA)

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

12 years agogodoc: restore toy selection to playground widget
Andrew Gerrand [Wed, 10 Oct 2012 22:53:37 +0000 (09:53 +1100)]
godoc: restore toy selection to playground widget

Fixes #4225.

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

12 years agodoc/godoc.js: assign tmp. id to nodes without id in generateTOC()
Shenghou Ma [Wed, 10 Oct 2012 22:24:15 +0000 (09:24 +1100)]
doc/godoc.js: assign tmp. id to nodes without id in generateTOC()

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

12 years agogodoc: fix site for large displays
Andrew Gerrand [Wed, 10 Oct 2012 22:18:23 +0000 (09:18 +1100)]
godoc: fix site for large displays

R=golang-dev, skybrian
CC=golang-dev
https://golang.org/cl/6643062

12 years agotest: convert tests to run.go whenever possible.
Rémy Oudompheng [Wed, 10 Oct 2012 20:35:27 +0000 (22:35 +0200)]
test: convert tests to run.go whenever possible.

The other tests either need a complex procedure
or are architecture- or OS-dependent.

Update #4139.

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

12 years agocontainer/heap: optimization in case heap has many duplicates
Taj Khattra [Wed, 10 Oct 2012 18:35:57 +0000 (11:35 -0700)]
container/heap: optimization in case heap has many duplicates

benchmark       old ns/op    new ns/op    delta
BenchmarkDup      3075682       609448  -80.18%

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

12 years agoC+A: added Taj Khattra (individual CLA)
Robert Griesemer [Wed, 10 Oct 2012 18:35:43 +0000 (11:35 -0700)]
C+A: added Taj Khattra (individual CLA)

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

12 years agocmd/go: don't ignore error when 'go clean'
Shenghou Ma [Wed, 10 Oct 2012 17:34:26 +0000 (01:34 +0800)]
cmd/go: don't ignore error when 'go clean'
        Fixes #4208.

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

12 years agoruntime/debug: fix the test
Dmitriy Vyukov [Wed, 10 Oct 2012 16:49:18 +0000 (20:49 +0400)]
runtime/debug: fix the test
If source are not available, then the stack looks like:
stack_test.go:40:  /tmp/gobuilder/linux-amd64-race-72b15c5d6f65/go/src/pkg/runtime/debug/bla-bla-bla/src/pkg/runtime/debug/stack_test.go:15 (0x43fb11)
stack_test.go:40:  /tmp/gobuilder/linux-amd64-race-72b15c5d6f65/go/src/pkg/runtime/debug/bla-bla-bla/src/pkg/runtime/debug/stack_test.go:18 (0x43fb7a)
stack_test.go:40:  /tmp/gobuilder/linux-amd64-race-72b15c5d6f65/go/src/pkg/runtime/debug/bla-bla-bla/src/pkg/runtime/debug/stack_test.go:37 (0x43fbf4)
stack_test.go:40:  /tmp/gobuilder/linux-amd64-race-72b15c5d6f65/go/src/pkg/testing/bla-bla-bla/src/pkg/testing/testing.go:301 (0x43b5ba)
stack_test.go:40:  /tmp/gobuilder/linux-amd64-race-72b15c5d6f65/go/src/pkg/runtime/bla-bla-bla/src/pkg/runtime/proc.c:276 (0x410670)
stack_test.go:40:
which is 6 lines.

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

12 years agocodereview.py: Fix crash on auth error handling.
Uriel Mangado [Wed, 10 Oct 2012 16:23:53 +0000 (00:23 +0800)]
codereview.py: Fix crash on auth error handling.

In recent Python versions .reason is a read-only property that simply gives you the msg value.

Fixes #4024

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

12 years agocmd/gc: fix compiler crash during race instrumentation
Dmitriy Vyukov [Wed, 10 Oct 2012 14:09:23 +0000 (18:09 +0400)]
cmd/gc: fix compiler crash during race instrumentation
The compiler is crashing on the following code:

type TypeID int
func (t *TypeID) encodeType(x int) (tt TypeID, err error) {
        switch x {
        case 0:
                return t.encodeType(x * x)
        }
        return 0, nil
}
The pass marks "return struct" {tt TypeID, err error} as used,
and this causes internal check failure.
I've added the test to:
https://golang.org/cl/6525052/diff/7020/src/pkg/runtime/race/regression_test.go

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

12 years agoruntime: fix race detector handling of stackalloc()
Dmitriy Vyukov [Wed, 10 Oct 2012 14:06:29 +0000 (18:06 +0400)]
runtime: fix race detector handling of stackalloc()

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

12 years agospec: clarify defer semantics
Rob Pike [Wed, 10 Oct 2012 02:29:50 +0000 (13:29 +1100)]
spec: clarify defer semantics
It's already there but only in the "for instance" and so not
clear enough: deferred functions run after
the result parameters are updated.

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

12 years agoA+C: change Sergio Correia's email address
Andrew Gerrand [Wed, 10 Oct 2012 02:11:06 +0000 (13:11 +1100)]
A+C: change Sergio Correia's email address

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

12 years agobytes: fix tests and fix build
Andrew Gerrand [Wed, 10 Oct 2012 00:59:39 +0000 (11:59 +1100)]
bytes: fix tests and fix build

R=golang-dev, edsrzf
CC=golang-dev
https://golang.org/cl/6633051

12 years agogodoc: add dropdown playground to nav bar
Andrew Gerrand [Wed, 10 Oct 2012 00:17:47 +0000 (11:17 +1100)]
godoc: add dropdown playground to nav bar

R=gri, dsymonds, skybrian
CC=golang-dev
https://golang.org/cl/6631057

12 years agobytes: make examples work in playground
Andrew Gerrand [Wed, 10 Oct 2012 00:15:41 +0000 (11:15 +1100)]
bytes: make examples work in playground

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

12 years agogo/printer: idempotent comment formatting
Robert Griesemer [Wed, 10 Oct 2012 00:08:09 +0000 (17:08 -0700)]
go/printer: idempotent comment formatting

Also:

- Refactored testing framework to permit easier
idempotency testing.

- Applied gofmt -w src misc

This CL depends on CL 6639044 being applied first.

Formatting is not idempotent for all files: In those
files the comment position has changed (due to missing
precise location information) and/or the comment formatting
cannot/is not aware of independent code re-formatting.
In general it is very hard to make format idempotent when
running it in one pass only. Leaving that aside for now.

Fixes #1835.

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

12 years agogofmt: apply gofmt -w -s src misc
Robert Griesemer [Wed, 10 Oct 2012 00:01:28 +0000 (17:01 -0700)]
gofmt: apply gofmt -w -s src misc

Preparation for forthcoming CL 6624051: Will make it
easier to see if/what changes are incurred by it.

The alignment changes in this CL are due to CL 6610051
(fix to alignment heuristic) where it appears that an
old version of gofmt was run (and thus the correct
alignment updates were not done).

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

12 years agocmd/ld: add -B option to set build ID
Ian Lance Taylor [Tue, 9 Oct 2012 22:29:43 +0000 (15:29 -0700)]
cmd/ld: add -B option to set build ID

Background on build ID:
http://fedoraproject.org/wiki/RolandMcGrath/BuildID

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

12 years agonet/http: fix name of result parameter in a comment
Brad Fitzpatrick [Tue, 9 Oct 2012 18:16:35 +0000 (11:16 -0700)]
net/http: fix name of result parameter in a comment

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

12 years agomisc/cgo/test: add -ldl to LDFLAGS on Linux, ignore issue4029 on windows (fix build)
Shenghou Ma [Tue, 9 Oct 2012 17:30:34 +0000 (01:30 +0800)]
misc/cgo/test: add -ldl to LDFLAGS on Linux, ignore issue4029 on windows (fix build)

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

12 years agocrypto/tls: fix NPN extension parsing.
Adam Langley [Tue, 9 Oct 2012 17:25:47 +0000 (13:25 -0400)]
crypto/tls: fix NPN extension parsing.

I typoed the code and tried to parse all the way to the end of the
message. Therefore it fails when NPN is not the last extension in the
ServerHello.

Fixes #4088.

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

12 years agoio/ioutil: fix data race on rand
Dmitriy Vyukov [Tue, 9 Oct 2012 17:08:53 +0000 (21:08 +0400)]
io/ioutil: fix data race on rand
Fixes #4212.

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

12 years agocmd/5l: generate FreeBSD compatible ELF
Shenghou Ma [Tue, 9 Oct 2012 17:02:49 +0000 (01:02 +0800)]
cmd/5l: generate FreeBSD compatible ELF
1. correctly initialize .plt.got entries (point to the 1st entry)
2. add section .rel.plt (FreeBSD insists PLT relocs to be there)
3. put relocs of .got.plt into .rel.plt
4. set ELFOSABI_FREEBSD in ELF header

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

12 years agocmd/ld, cmd/6l, cmd/8l: sort exported dynamic symbols for Darwin
Shenghou Ma [Tue, 9 Oct 2012 16:55:48 +0000 (00:55 +0800)]
cmd/ld, cmd/6l, cmd/8l: sort exported dynamic symbols for Darwin
Also corrected cmd/8l's .dynsym handling (differentiate between exported symbols and imported symbols)

        Fixes #4029.

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

12 years agorace: syscall changes
Dmitriy Vyukov [Tue, 9 Oct 2012 16:51:58 +0000 (20:51 +0400)]
race: syscall changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
The purpose of this patch is to provide coarse-grained synchronization
between all Read() and Write() calls.

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

12 years agocmd/ld: use 64-bit alignment for large data and bss objects
Russ Cox [Tue, 9 Oct 2012 16:50:06 +0000 (12:50 -0400)]
cmd/ld: use 64-bit alignment for large data and bss objects

Check for specific, important misalignment in garbage collector.
Not a complete fix for issue 599 but an important workaround.

Update #599.

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

12 years agocmd/fix: disable reflect test under race detector (very slow)
Dmitriy Vyukov [Tue, 9 Oct 2012 16:21:39 +0000 (20:21 +0400)]
cmd/fix: disable reflect test under race detector (very slow)

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

12 years agocmd/go: fix handling of build tags for standard commands
Dmitriy Vyukov [Tue, 9 Oct 2012 15:54:14 +0000 (19:54 +0400)]
cmd/go: fix handling of build tags for standard commands
Otherwise if I add '+build !race' to e.g. src/cmd/fix/reflect_test.go,
it does not work.

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

12 years agoencoding/gob: add test case for issue 4214.
Dmitriy Vyukov [Tue, 9 Oct 2012 05:55:57 +0000 (09:55 +0400)]
encoding/gob: add test case for issue 4214.
See http://code.google.com/p/go/issues/detail?id=4214

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

12 years agoencoding/gob: fix data race in Register
Rob Pike [Tue, 9 Oct 2012 00:56:38 +0000 (11:56 +1100)]
encoding/gob: fix data race in Register
Fixes #4214.

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

12 years agodebug/pe: support PE files which contain no symbol table (if NumberOfSymbols is equal...
Robin Eklind [Tue, 9 Oct 2012 00:15:53 +0000 (11:15 +1100)]
debug/pe: support PE files which contain no symbol table (if NumberOfSymbols is equal to 0 in the IMAGE_FILE_HEADER structure).

No longer assume that e_lfanew (in the IMAGE_DOS_HEADER strcuture) is always one byte. It is now regarded as a 4 byte uint32.

Fixes #4177.

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

12 years agoA+C: added Robin Eklind (individual CLA)
Robert Griesemer [Tue, 9 Oct 2012 00:14:44 +0000 (17:14 -0700)]
A+C: added Robin Eklind (individual CLA)

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

12 years agogodoc: support Playground examples on App Engine
Andrew Gerrand [Mon, 8 Oct 2012 22:57:51 +0000 (09:57 +1100)]
godoc: support Playground examples on App Engine

Updates setup-godoc-app.bash to produce a working godoc app
by substituting the go1.0.x go/... packages with those from tip.

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

12 years agotesting: change -test.benchtime to a flag.Duration.
David Symonds [Mon, 8 Oct 2012 21:57:29 +0000 (08:57 +1100)]
testing: change -test.benchtime to a flag.Duration.

Fixes #3902.

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

12 years agoencoding/base{32,64}: add examples.
David Symonds [Mon, 8 Oct 2012 21:56:34 +0000 (08:56 +1100)]
encoding/base{32,64}: add examples.

Fixes #4136.

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

12 years agonet/url: report first error from ParseQuery.
David Symonds [Mon, 8 Oct 2012 21:10:32 +0000 (08:10 +1100)]
net/url: report first error from ParseQuery.

Fixes #4175.

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

12 years agotest: Make run.go's errorcheck behave like testlib.
Daniel Morsing [Mon, 8 Oct 2012 14:36:45 +0000 (16:36 +0200)]
test: Make run.go's errorcheck behave like testlib.

testlib will complain about any unmatched errors left in errorchecks while run.go will not.

Fixes #4141.

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