1
0
mirror of https://github.com/golang/go synced 2024-09-25 15:10:11 -06:00
Commit Graph

14152 Commits

Author SHA1 Message Date
Shenghou Ma
6e0df254b0 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
2012-10-16 14:28:18 +08:00
Rémy Oudompheng
7e144bcab0 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
2012-10-16 07:22:33 +02:00
Brad Fitzpatrick
bcf88de5ff 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
2012-10-15 20:49:15 -07:00
Brad Fitzpatrick
08d66439b4 builder: label the race builder as "race"
R=golang-dev, adg, dave, rsc, minux.ma, dvyukov
CC=golang-dev
https://golang.org/cl/6648043
2012-10-15 20:30:41 -07:00
Rob Pike
15970c8d6d 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
2012-10-16 11:27:20 +11:00
Dmitriy Vyukov
6273c7324f runtime: add missing if(raceenabled)
R=0xe2.0x9a.0x9b, minux.ma, iant, dave
CC=golang-dev
https://golang.org/cl/6654052
2012-10-15 13:54:31 +04:00
Nigel Tao
1f31598e86 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
2012-10-15 13:28:30 +11:00
Nigel Tao
8b624f607f 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
2012-10-15 11:21:20 +11:00
David Symonds
f2045aadd9 time: accept numbers larger than 2^32 in ParseDuration.
Fixes #3374.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6683047
2012-10-15 07:50:13 +11:00
Shenghou Ma
240834374a 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
2012-10-13 19:05:22 +08:00
Anthony Martin
422da762b7 compress/bzip2: use io.ByteReader instead of internal interface
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6663044
2012-10-12 14:09:24 -07:00
Shenghou Ma
366268aa79 runtime: FreeBSD/ARM support
R=rsc
CC=golang-dev
https://golang.org/cl/6625071
2012-10-12 23:19:39 +08:00
Shenghou Ma
ef2ee4526e 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
2012-10-12 18:50:41 +08:00
Shenghou Ma
378d7ef59f syscall: FreeBSD/ARM support
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6657048
2012-10-12 16:26:42 +08:00
Shenghou Ma
1e9f308545 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
2012-10-12 13:39:12 +08:00
Shenghou Ma
19dc7bb18f 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
2012-10-12 13:35:05 +08:00
Rob Pike
e171b97ee6 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
2012-10-12 16:16:55 +11:00
Evan Shaw
eae25d430d bytes, strings: add (*Reader).WriteTo
Fixes #4031.

R=golang-dev, bradfitz, remyoudompheng, r, dave
CC=golang-dev
https://golang.org/cl/6632046
2012-10-12 14:43:50 +11:00
Rob Pike
06d42690b6 time: delete erroneous word from documentation.
Fixes #4236.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6658051
2012-10-12 11:00:00 +11:00
Andrew Gerrand
bd6601f4a0 os/signal: add Notify example
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/6615078
2012-10-12 10:22:13 +11:00
Robert Griesemer
4bee88d45f 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
2012-10-11 16:04:03 -07:00
Adam Langley
3acce59b93 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
2012-10-11 18:25:23 -04:00
Dave Cheney
a14f87ca81 net/http: fix data race on countReader.n
Fixes #4220.

R=dvyukov, bradfitz
CC=golang-dev
https://golang.org/cl/6638053
2012-10-12 09:17:56 +11:00
Dave Cheney
f1b1753627 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
2012-10-12 08:32:56 +11:00
Adam Langley
6720997f9e 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
2012-10-11 15:28:02 -04:00
Shenghou Ma
4c473c02e1 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
2012-10-11 23:33:57 +08:00
Andrew Gerrand
b13c7eec64 godoc: update favicon
R=golang-dev
CC=golang-dev
https://golang.org/cl/6641058
2012-10-11 17:02:36 +11:00
Andrew Gerrand
2100947d4a 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
2012-10-11 14:21:19 +11:00
Jimmy Zelinskie
dad1228cc3 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
2012-10-11 13:07:34 +11:00
Andrew Gerrand
a3d116cf78 A+C: add Jimmy Zelinskie (Individual CLA)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6642068
2012-10-11 11:20:01 +11:00
Andrew Gerrand
bd31e62982 godoc: restore toy selection to playground widget
Fixes #4225.

R=golang-dev
CC=golang-dev
https://golang.org/cl/6640054
2012-10-11 09:53:37 +11:00
Shenghou Ma
6572c7ee93 doc/godoc.js: assign tmp. id to nodes without id in generateTOC()
R=adg
CC=golang-dev
https://golang.org/cl/6604062
2012-10-11 09:24:15 +11:00
Andrew Gerrand
7e196d0822 godoc: fix site for large displays
R=golang-dev, skybrian
CC=golang-dev
https://golang.org/cl/6643062
2012-10-11 09:18:23 +11:00
Rémy Oudompheng
dda1b560ec 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
2012-10-10 22:35:27 +02:00
Taj Khattra
c12dab2aa6 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
2012-10-10 11:35:57 -07:00
Robert Griesemer
4c9c36e655 C+A: added Taj Khattra (individual CLA)
R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/6635061
2012-10-10 11:35:43 -07:00
Shenghou Ma
bf7d229eb8 cmd/go: don't ignore error when 'go clean'
Fixes #4208.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6635064
2012-10-11 01:34:26 +08:00
Dmitriy Vyukov
be2b95fe3a 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
2012-10-10 20:49:18 +04:00
Uriel Mangado
df7b720708 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
2012-10-11 00:23:53 +08:00
Dmitriy Vyukov
21b2ce724a 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
2012-10-10 18:09:23 +04:00
Dmitriy Vyukov
27e93fbd00 runtime: fix race detector handling of stackalloc()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6632051
2012-10-10 18:06:29 +04:00
Rob Pike
f04ae1373e 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
2012-10-10 13:29:50 +11:00
Andrew Gerrand
c91538f9c9 A+C: change Sergio Correia's email address
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6631059
2012-10-10 13:11:06 +11:00
Andrew Gerrand
749a445ba0 bytes: fix tests and fix build
R=golang-dev, edsrzf
CC=golang-dev
https://golang.org/cl/6633051
2012-10-10 11:59:39 +11:00
Andrew Gerrand
8438641629 godoc: add dropdown playground to nav bar
R=gri, dsymonds, skybrian
CC=golang-dev
https://golang.org/cl/6631057
2012-10-10 11:17:47 +11:00
Andrew Gerrand
e7c222cada bytes: make examples work in playground
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6633050
2012-10-10 11:15:41 +11:00
Robert Griesemer
241b23606c 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
2012-10-09 17:08:09 -07:00
Robert Griesemer
af79568fde 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
2012-10-09 17:01:28 -07:00
Ian Lance Taylor
32316bba5b 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
2012-10-09 15:29:43 -07:00
Brad Fitzpatrick
dfc7304d32 net/http: fix name of result parameter in a comment
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6632053
2012-10-09 11:16:35 -07:00