]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agoC: add Michael Matloob (Google CLA)
Robert Griesemer [Thu, 14 Feb 2013 19:25:33 +0000 (11:25 -0800)]
C: add Michael Matloob (Google CLA)

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

12 years agosyscall: don't make //sys lines be doc comments
Brad Fitzpatrick [Thu, 14 Feb 2013 19:23:58 +0000 (11:23 -0800)]
syscall: don't make //sys lines be doc comments

Cleans up godoc and makes it consistent. (some had it, some
didn't)

This still keeps the information there, though, for people
looking at the source directly.

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

12 years agocmd/go: set $PWD when running commands
Russ Cox [Thu, 14 Feb 2013 19:21:44 +0000 (14:21 -0500)]
cmd/go: set $PWD when running commands

This makes os.Getwd inside those commands much faster.

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

12 years agotest/run: use correct $PWD to make os.Getwd less expensive
Russ Cox [Thu, 14 Feb 2013 19:21:26 +0000 (14:21 -0500)]
test/run: use correct $PWD to make os.Getwd less expensive

The commands being run are 'go tool this' and 'go tool that',
and the go command will call Getwd during its init.

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

12 years agoos: cache Getwd result as hint for next time
Russ Cox [Thu, 14 Feb 2013 19:21:09 +0000 (14:21 -0500)]
os: cache Getwd result as hint for next time

Avoids the dot-dot-based algorithm on repeated calls
when the directory hasn't changed.

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

12 years agonet: document OpError
Brad Fitzpatrick [Thu, 14 Feb 2013 17:29:34 +0000 (09:29 -0800)]
net: document OpError

Fixes #4797

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

12 years agoexp/cookiejar: implement Cookies and provided tests
Volker Dobler [Thu, 14 Feb 2013 08:41:58 +0000 (19:41 +1100)]
exp/cookiejar: implement Cookies and provided tests

This CL provides the implementation of Cookies and
the complete test suite. Several tests have been ported
from the Chromium project as a cross check.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7311073

12 years agoruntime: move stack management related code to stack.c
Dmitriy Vyukov [Thu, 14 Feb 2013 08:37:55 +0000 (12:37 +0400)]
runtime: move stack management related code to stack.c
No code changes.
This is mainly in preparation to scheduler changes,
oldstack/newstack are not related to scheduling.

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

12 years agonet/textproto: more efficient header parsing
Dave Cheney [Thu, 14 Feb 2013 08:35:38 +0000 (19:35 +1100)]
net/textproto: more efficient header parsing

A co creation with bradfitz

* add fast path for header lines which are not continuations
* pass hint to better size initial mime header map

lucky(~/go/src/pkg/net/http) % ~/go/misc/benchcmp {golden,new}.txt
benchmark                          old ns/op    new ns/op    delta
BenchmarkReadRequestChrome             10073         8348  -17.12%
BenchmarkReadRequestCurl                4368         4350   -0.41%
BenchmarkReadRequestApachebench         4412         4397   -0.34%
BenchmarkReadRequestSiege               6431         5924   -7.88%
BenchmarkReadRequestWrk                 2820         3146  +11.56%

benchmark                           old MB/s     new MB/s  speedup
BenchmarkReadRequestChrome             60.66        73.18    1.21x
BenchmarkReadRequestCurl               17.85        17.93    1.00x
BenchmarkReadRequestApachebench        18.58        18.65    1.00x
BenchmarkReadRequestSiege              23.48        25.49    1.09x
BenchmarkReadRequestWrk                14.18        12.71    0.90x

benchmark                         old allocs   new allocs    delta
BenchmarkReadRequestChrome                32           26  -18.75%
BenchmarkReadRequestCurl                  15           15    0.00%
BenchmarkReadRequestApachebench           16           15   -6.25%
BenchmarkReadRequestSiege                 22           19  -13.64%
BenchmarkReadRequestWrk                   11           11    0.00%

benchmark                          old bytes    new bytes    delta
BenchmarkReadRequestChrome              3148         2216  -29.61%
BenchmarkReadRequestCurl                 905         1413   56.13%
BenchmarkReadRequestApachebench          956         1413   47.80%
BenchmarkReadRequestSiege               1397         1522    8.95%
BenchmarkReadRequestWrk                  757         1369   80.85%

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

12 years agoarchive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.
Robin Eklind [Thu, 14 Feb 2013 06:32:48 +0000 (17:32 +1100)]
archive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.

FileInfoHeader can now handle fifo, setuid, setgid and sticky bits.

Fixes #4695.

R=golang-dev, donovanhide, r.eklind.87, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7305072

12 years agosort: use fewer comparisons when choosing pivot.
David Symonds [Thu, 14 Feb 2013 04:04:22 +0000 (15:04 +1100)]
sort: use fewer comparisons when choosing pivot.

This is based on rsc's code posted to issue 2585.

Benchmark results are greatly improved:
        benchmark                old ns/op    new ns/op    delta
        BenchmarkSortString1K       564397       445897  -21.00%
        BenchmarkSortInt1K          270889       221249  -18.32%
        BenchmarkSortInt64K       26850765     21351967  -20.48%

Eyeballing a sampling of the raw number of comparisons shows a drop
on the order of 20-30% almost everywhere. The test input data that
doesn't match that are some of sawtooth/rand/plateau distributions,
where there is no change in the number of comparisons; that is,
there are no situations where this makes *more* comparisons.

Fixes #2585.

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

12 years agocmd/vet: drop column information from error
Russ Cox [Thu, 14 Feb 2013 03:34:37 +0000 (22:34 -0500)]
cmd/vet: drop column information from error

The column information can be misleading.

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

12 years agoruntime: tweak addfinroots to preserve original pointer
Russ Cox [Thu, 14 Feb 2013 03:31:45 +0000 (22:31 -0500)]
runtime: tweak addfinroots to preserve original pointer

Use local variable so that stack trace will show value of v.

Fixes #4790.

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

12 years agodatabase/sql: fix doc references to old package name
Brad Fitzpatrick [Thu, 14 Feb 2013 02:47:25 +0000 (18:47 -0800)]
database/sql: fix doc references to old package name

It used to be package "db" but was long ago renamed
to be "sql".

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

12 years agonet/http: test that we preserve Go 1.0 Request.Write Host behavior
Brad Fitzpatrick [Thu, 14 Feb 2013 02:33:15 +0000 (18:33 -0800)]
net/http: test that we preserve Go 1.0 Request.Write Host behavior

Fixes #4792

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

12 years agocmd/8c: disable use of prefetch with GO386=387
Russ Cox [Thu, 14 Feb 2013 02:13:07 +0000 (21:13 -0500)]
cmd/8c: disable use of prefetch with GO386=387

Fixes #4798.

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

12 years agodatabase/sql: Add an optional Queryer-Interface (like Execer)
Julien Schmidt [Wed, 13 Feb 2013 23:25:39 +0000 (15:25 -0800)]
database/sql: Add an optional Queryer-Interface (like Execer)

Completly the same like the Execer-Interface, just for Queries.
This allows Drivers to execute Queries without preparing them first

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

12 years agonet: remove noisy test for issue 3590
Dave Cheney [Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)]
net: remove noisy test for issue 3590

The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage.

Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships.

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

12 years agonet: add test for Dial and Listen arguments
Mikio Hara [Wed, 13 Feb 2013 22:02:32 +0000 (07:02 +0900)]
net: add test for Dial and Listen arguments

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

12 years agoio: document and test new CopyN return behavior
Brad Fitzpatrick [Wed, 13 Feb 2013 21:52:00 +0000 (13:52 -0800)]
io: document and test new CopyN return behavior

Changed accidentally in 28966b7b2f0c (CopyN using Copy).
Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast)

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

12 years agocmd/5l: fix print format
Lucio De Re [Wed, 13 Feb 2013 21:47:33 +0000 (16:47 -0500)]
cmd/5l: fix print format

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

12 years agodatabase/sql: add currently-disabled broken test
Brad Fitzpatrick [Wed, 13 Feb 2013 20:00:03 +0000 (12:00 -0800)]
database/sql: add currently-disabled broken test

Update #3865

R=golang-dev, alex.brainman, nightlyone
CC=golang-dev
https://golang.org/cl/7324051

12 years agogo/types: adjust gcimporter to actual gc export data
Robert Griesemer [Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)]
go/types: adjust gcimporter to actual gc export data

Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

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

12 years agoruntime: instrument slicebytetostring for race detection
Dmitriy Vyukov [Wed, 13 Feb 2013 14:29:59 +0000 (18:29 +0400)]
runtime: instrument slicebytetostring for race detection

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

12 years agoarchive/tar: append a slash when deriving header info from a directory
Christian Himpel [Wed, 13 Feb 2013 08:23:28 +0000 (19:23 +1100)]
archive/tar: append a slash when deriving header info from a directory

This behavior is identical to GNU tar 1.26.

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

12 years agodoc: adjust indentation in Effective Go commentary example.
David Symonds [Wed, 13 Feb 2013 05:43:55 +0000 (16:43 +1100)]
doc: adjust indentation in Effective Go commentary example.

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

12 years agonet: change server_test.go so we could see failure messages
Alex Brainman [Wed, 13 Feb 2013 05:17:47 +0000 (16:17 +1100)]
net: change server_test.go so we could see failure messages

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

12 years agoexp/ssa: add Instruction.Operands and Value.Referrers methods.
Alan Donovan [Wed, 13 Feb 2013 05:15:07 +0000 (00:15 -0500)]
exp/ssa: add Instruction.Operands and Value.Referrers methods.

Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values.  These will be used for SSA renaming, to follow.

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

12 years agogo/types: print, println accept 0 or more arguments
Robert Griesemer [Wed, 13 Feb 2013 03:40:20 +0000 (19:40 -0800)]
go/types: print, println accept 0 or more arguments

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

12 years agoos: do not use hosts file for windows tests
Alex Brainman [Wed, 13 Feb 2013 02:19:06 +0000 (13:19 +1100)]
os: do not use hosts file for windows tests

Not everyone has the file (http://golang.org/issue/4723#c4).

Update #4723.

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

12 years agoexp/ssa: omit Function's package name when printing intra-package references.
Alan Donovan [Tue, 12 Feb 2013 21:13:14 +0000 (16:13 -0500)]
exp/ssa: omit Function's package name when printing intra-package references.

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

12 years agoencoding/xml: fix htmlAutoClose and its generating script
Shenghou Ma [Tue, 12 Feb 2013 18:27:42 +0000 (02:27 +0800)]
encoding/xml: fix htmlAutoClose and its generating script
Thanks Mitică for reporting this.

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

12 years agotest: ensure all failing tests exit nonzero.
Alan Donovan [Tue, 12 Feb 2013 18:17:49 +0000 (13:17 -0500)]
test: ensure all failing tests exit nonzero.

Previously merely printing an error would cause the golden
file comparison (in 'bash run') to fail, but that is no longer
the case with the new run.go driver.

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

12 years agogo/build, runtime/cgo: cgo support for NetBSD/ARM
Shenghou Ma [Tue, 12 Feb 2013 17:06:52 +0000 (01:06 +0800)]
go/build, runtime/cgo: cgo support for NetBSD/ARM

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

12 years agosync/atomic: support NetBSD/ARM (ARM11 or above)
Shenghou Ma [Tue, 12 Feb 2013 17:04:13 +0000 (01:04 +0800)]
sync/atomic: support NetBSD/ARM (ARM11 or above)

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

12 years agosyscall: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:03:25 +0000 (01:03 +0800)]
syscall: NetBSD/ARM support

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

12 years agoruntime: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:00:04 +0000 (01:00 +0800)]
runtime: NetBSD/ARM support

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

12 years agoexp/locale/collate: moved low-level collation functionality
Marcel van Lohuizen [Tue, 12 Feb 2013 14:59:55 +0000 (15:59 +0100)]
exp/locale/collate: moved low-level collation functionality
into separate package.  This allows this code to be shared
with the search package without the need for these two to use
the same tables.
Adjusted various files accordingly.

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

12 years agogo/types: len(((*T)(nil)).X) is const if X is an array
Robert Griesemer [Tue, 12 Feb 2013 06:39:55 +0000 (22:39 -0800)]
go/types: len(((*T)(nil)).X) is const if X is an array

Fixes #4744.

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

12 years agoexp/ssa: special-case 'range' loops based on type of range expression.
Alan Donovan [Tue, 12 Feb 2013 03:12:56 +0000 (22:12 -0500)]
exp/ssa: special-case 'range' loops based on type of range expression.

The lowering of ast.RangeStmt now has three distinct cases:

1) rangeIter for maps and strings; approximately:
    it = range x
    for {
      k, v, ok = next it
      if !ok { break }
      ...
    }
   The Range instruction and the interpreter's "iter"
   datatype are now restricted to these types.

2) rangeChan for channels; approximately:
    for {
      k, ok = <-x
      if !ok { break }
      ...
    }

3) rangeIndexed for slices, arrays, and *array; approximately:
    for k, l = 0, len(x); k < l; k++ {
      v = x[k]
      ...
    }

In all cases we now evaluate the side effects of the range expression
exactly once, per comments on http://code.google.com/p/go/issues/detail?id=4644.

However the exact spec wording is still being discussed in
https://golang.org/cl/7307083/.  Further (small)
changes may be required once the dust settles.

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

12 years agotest: a number of fixes.
Alan Donovan [Mon, 11 Feb 2013 23:20:52 +0000 (18:20 -0500)]
test: a number of fixes.

Details:
- reorder.go: delete p8.
  (Once expectation is changed per b/4627 it is identical to p1.)
- switch.go: added some more (degenerate) switches.
- range.go: improved error messages in a few cases.
- method.go: added tests of calls to promoted methods.

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

12 years agovet: improve flag handling
Rob Pike [Mon, 11 Feb 2013 21:33:11 +0000 (13:33 -0800)]
vet: improve flag handling
Simplify the internal logic for flags controlling what to vet,
by introducing a map of flags that gathers them all together.
This change should simplify the process of adding further flags.

Add a test for untagged struct literals.
Delete a redundant test that was also in the wrong file.
Clean up some ERROR patterns that weren't working.

"make test" passes again.

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

12 years agoapi: Update readme.
Robin Eklind [Mon, 11 Feb 2013 17:10:35 +0000 (09:10 -0800)]
api: Update readme.

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

12 years agosync: add caution about where to call (*WaitGroup).Add
Russ Cox [Mon, 11 Feb 2013 13:05:46 +0000 (08:05 -0500)]
sync: add caution about where to call (*WaitGroup).Add

Fixes #4762.

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

12 years agospec: only require parens around ambiguous conversions
Russ Cox [Mon, 11 Feb 2013 12:48:14 +0000 (07:48 -0500)]
spec: only require parens around ambiguous conversions

This is documenting the status quo. The previous cleanup
added this language as an implementation restriction, but
at least for now it is really part of the language proper.

Fixes #4605.

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

12 years agospec: document fp rounding during explicit constant conversion
Russ Cox [Mon, 11 Feb 2013 12:47:41 +0000 (07:47 -0500)]
spec: document fp rounding during explicit constant conversion

The gc compilers already behave this way. It was an explicit
decision during the very long constant design discussions,
but it appears not to have made it into the spec.

Fixes #4398.

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

12 years agospec: reject top-level init names
Russ Cox [Mon, 11 Feb 2013 12:46:39 +0000 (07:46 -0500)]
spec: reject top-level init names

Fixes #4586.

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

12 years agomisc/dashboard: add missing return value
Andrew Gerrand [Mon, 11 Feb 2013 07:01:18 +0000 (18:01 +1100)]
misc/dashboard: add missing return value

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

12 years agocontainer/list: add package example
Andrew Gerrand [Mon, 11 Feb 2013 06:59:52 +0000 (17:59 +1100)]
container/list: add package example

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

12 years agoexp/html, exp/html/atom: delete, as they're moving to the go.net
Nigel Tao [Mon, 11 Feb 2013 00:56:49 +0000 (11:56 +1100)]
exp/html, exp/html/atom: delete, as they're moving to the go.net
sub-repo.

The matching change is at https://golang.org/cl/7310063

The rationale was discussed at
https://groups.google.com/d/topic/golang-nuts/Qq5hTQyPuLg/discussion

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

12 years agoexp/cookiejar: implementation of SetCookies
Volker Dobler [Mon, 11 Feb 2013 00:47:31 +0000 (11:47 +1100)]
exp/cookiejar: implementation of SetCookies

This CL provides the rest of the SetCookies code as well as
some test infrastructure which will be used to test also
the Cookies method. This test infrastructure is optimized
for readability and tries to make it easy to review table
driven test cases.

Tests for all the different corner cases of SetCookies
will be provided in a separate CL.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7306054

12 years agodoc: update contribute.html
Dave Cheney [Mon, 11 Feb 2013 00:40:33 +0000 (19:40 -0500)]
doc: update contribute.html

Fixes #4582.

* mentioned hg upload.
* added section on hg file.
* added small mention about being inside $GOROOT.
* added hg revert @NNNN
* reorganise the hg submit section for the common case of a non committer.
* made the Copyright section h2
* added note about leaving copyright years unchanged.

R=golang-dev, metanata4, shivakumar.gn, minux.ma, adg, shanemhansen
CC=golang-dev, metanata4
https://golang.org/cl/7278047

12 years agoarchive/tar: read/write extended pax/gnu tar archives
Shane Hansen [Mon, 11 Feb 2013 00:36:29 +0000 (11:36 +1100)]
archive/tar: read/write extended pax/gnu tar archives

Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.

Fixes #3300

R=dsymonds, dave, rogpeppe, remyoudompheng, chressie, rsc
CC=golang-dev
https://golang.org/cl/6700047

12 years agocmd/8l/asm.c: Unused function arguments, suppress warnings.
Lucio De Re [Sun, 10 Feb 2013 23:15:56 +0000 (10:15 +1100)]
cmd/8l/asm.c: Unused function arguments, suppress warnings.

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

12 years agodoc: move os specific build instructions to wiki
Dave Cheney [Sun, 10 Feb 2013 22:39:13 +0000 (17:39 -0500)]
doc: move os specific build instructions to wiki

Fixes #4010.

This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.

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

12 years agodoc: link to wiki Projects page instead of old Project Dashboard.
Greg Ward [Sun, 10 Feb 2013 22:18:31 +0000 (09:18 +1100)]
doc: link to wiki Projects page instead of old Project Dashboard.

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

12 years agoA+C: Greg Ward (individual CLA)
Andrew Gerrand [Sun, 10 Feb 2013 22:17:00 +0000 (09:17 +1100)]
A+C: Greg Ward (individual CLA)

Generated by addca.

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

12 years agospec: clarify that any unsafe.Pointer type is okay in conversion
Russ Cox [Sat, 9 Feb 2013 22:36:31 +0000 (17:36 -0500)]
spec: clarify that any unsafe.Pointer type is okay in conversion

The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.

Fixes #4679.

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

12 years agonet/http: more request benchmarks
Dave Cheney [Sat, 9 Feb 2013 21:18:09 +0000 (08:18 +1100)]
net/http: more request benchmarks

Add benchmarks for common http benchmarking tools. The intent is to catch optimisations which favor synthetic benchmarks that do not show improvements for real clients like Chrome.

BenchmarkReadRequestChrome        200000             10133 ns/op          60.29 MB/s        3148 B/op         32 allocs/op
BenchmarkReadRequestCurl          500000              4314 ns/op          18.08 MB/s         905 B/op         15 allocs/op
BenchmarkReadRequestApachebench   500000              4363 ns/op          18.79 MB/s         956 B/op         16 allocs/op
BenchmarkReadRequestSiege         500000              6408 ns/op          24.19 MB/s        1397 B/op         22 allocs/op
BenchmarkReadRequestWrk          1000000              2838 ns/op          14.09 MB/s         757 B/op         11 allocs/op

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

12 years agospec: clarify that f(g()) requires that g return >= 1 value
Russ Cox [Sat, 9 Feb 2013 19:46:55 +0000 (14:46 -0500)]
spec: clarify that f(g()) requires that g return >= 1 value

Fixes #4573.

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

12 years agocrypto/x509: disable SCG test with system validation.
Adam Langley [Sat, 9 Feb 2013 18:51:39 +0000 (13:51 -0500)]
crypto/x509: disable SCG test with system validation.

On Windows, CryptoAPI is finding an alternative validation path. Since
this is a little non-deterministic, this change disables that test
when using system validation.

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

12 years agotesting: be explicit about use of b.N
Russ Cox [Sat, 9 Feb 2013 18:43:15 +0000 (13:43 -0500)]
testing: be explicit about use of b.N

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

12 years agocrypto/x509: allow MS/NS SCG key usage as ServerAuth.
Adam Langley [Sat, 9 Feb 2013 18:20:25 +0000 (13:20 -0500)]
crypto/x509: allow MS/NS SCG key usage as ServerAuth.

By default, crypto/x509 assumes that users wish to validate
certificates for ServerAuth. However, due to historical reasons,
COMODO's intermediates don't specify ServerAuth as an allowed key
usage.

Rather NSS and CryptoAPI both allow these SGC OIDs to be equivalent to
ServerAuth.

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

12 years agobytes: annotate assembly functions with //go:noescape
Shenghou Ma [Sat, 9 Feb 2013 16:08:30 +0000 (00:08 +0800)]
bytes: annotate assembly functions with //go:noescape

R=golang-dev, agl, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7299064

12 years agolog/syslog: remove socket files after tests
Shenghou Ma [Sat, 9 Feb 2013 00:19:09 +0000 (08:19 +0800)]
log/syslog: remove socket files after tests

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

12 years agonet: fix unixgram
Mikio Hara [Fri, 8 Feb 2013 23:18:32 +0000 (08:18 +0900)]
net: fix unixgram

The socket for AF_UNIX domain with SOCK_DGARM type isn't
allowed to work with syscall listen.

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

12 years agocmd/go: indicate that flags unrecognized by 'go test' must follow package specification
Robert Daniel Kortschak [Fri, 8 Feb 2013 21:00:59 +0000 (16:00 -0500)]
cmd/go: indicate that flags unrecognized by 'go test' must follow package specification

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

12 years agoruntime: precise garbage collection of hashmaps
Jan Ziak [Fri, 8 Feb 2013 21:00:33 +0000 (16:00 -0500)]
runtime: precise garbage collection of hashmaps

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

12 years agonet/http: add BenchmarkReadRequest
Dave Cheney [Fri, 8 Feb 2013 20:04:07 +0000 (07:04 +1100)]
net/http: add BenchmarkReadRequest

Add benchmark for request parsing. Fixture data is taken from https://github.com/felixge/node-http-perf

% go version
go version devel +28966b7b2f0c Thu Feb 07 20:26:12 2013 -0800 linux/amd64

% go test -run=nil -bench=ReadRequest -benchtime=10s
PASS
BenchmarkReadRequest     2000000   9900 ns/op   61.71 MB/s   3148 B/op   32 allocs/op
ok      net/http        12.180s

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

12 years agosyscall: check for invalid characters in Setenv on Unix
Péter Surányi [Fri, 8 Feb 2013 18:45:46 +0000 (10:45 -0800)]
syscall: check for invalid characters in Setenv on Unix

On POSIX, '=' in key is explicitly invalid, and '\x00' in key/value is implicitly invalid.

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

12 years agonet/http/httptest: add examples
Kamil Kisiel [Fri, 8 Feb 2013 17:20:05 +0000 (09:20 -0800)]
net/http/httptest: add examples

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

12 years agoexp/ssa/interp: fix MS Windows breakage.
Alan Donovan [Fri, 8 Feb 2013 16:58:24 +0000 (11:58 -0500)]
exp/ssa/interp: fix MS Windows breakage.

syscall.{Kill,Write} are not portable to MS Windows, so we
disable them for now.

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

12 years agoexp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.
Alan Donovan [Fri, 8 Feb 2013 15:43:53 +0000 (10:43 -0500)]
exp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.

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

12 years agoruntime/race: deflake tests
Dmitriy Vyukov [Fri, 8 Feb 2013 15:24:50 +0000 (19:24 +0400)]
runtime/race: deflake tests
With the new scheduler races in the tests are reported during execution of other tests.
The change joins goroutines started during the tests.

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

12 years agoruntime: fix integer overflow
Dmitriy Vyukov [Fri, 8 Feb 2013 15:05:19 +0000 (19:05 +0400)]
runtime: fix integer overflow
The problem happens when end=0, then end-1 is very big number.
Observed with the new scheduler.

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

12 years agonet: simplify Dial, Listen, ListenPacket and those helpers
Mikio Hara [Fri, 8 Feb 2013 12:53:10 +0000 (21:53 +0900)]
net: simplify Dial, Listen, ListenPacket and those helpers

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

12 years agonet: delete duplicate listenerSockaddr
Mikio Hara [Fri, 8 Feb 2013 08:02:08 +0000 (17:02 +0900)]
net: delete duplicate listenerSockaddr

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

12 years agocmd/5g: add missing splitclean.
Rémy Oudompheng [Fri, 8 Feb 2013 07:19:47 +0000 (08:19 +0100)]
cmd/5g: add missing splitclean.

See issue 887 for the 8g analogue.

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

12 years agoruntime: fix build for Linux/ARM
Shenghou Ma [Fri, 8 Feb 2013 05:24:38 +0000 (13:24 +0800)]
runtime: fix build for Linux/ARM

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

12 years agoio: Simplify CopyN implementation by delegating to Copy.
Jeremy Schlatter [Fri, 8 Feb 2013 04:26:12 +0000 (20:26 -0800)]
io: Simplify CopyN implementation by delegating to Copy.

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

12 years agoC: add Jeremy Schlatter (Google CLA)
Brad Fitzpatrick [Fri, 8 Feb 2013 04:25:10 +0000 (20:25 -0800)]
C: add Jeremy Schlatter (Google CLA)

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

12 years agocodereview: use hgapplydiff instead of hgpatch
Russ Cox [Fri, 8 Feb 2013 04:15:08 +0000 (23:15 -0500)]
codereview: use hgapplydiff instead of hgpatch

Depends on https://golang.org/cl/7308067

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

12 years agonet: do not use RLock around Accept
Russ Cox [Fri, 8 Feb 2013 03:45:12 +0000 (22:45 -0500)]
net: do not use RLock around Accept

It might be non-blocking, but it also might be blocking.
Cannot take the chance, as Accept might block indefinitely
and make it impossible to acquire ForkLock exclusively
(during fork+exec).

Fixes #4737.

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

12 years agocmd/godoc: fix format strings.
David Symonds [Fri, 8 Feb 2013 01:00:35 +0000 (12:00 +1100)]
cmd/godoc: fix format strings.

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

12 years agobytes: minor optimization to lastIndexFunc
Brad Fitzpatrick [Fri, 8 Feb 2013 00:00:06 +0000 (16:00 -0800)]
bytes: minor optimization to lastIndexFunc

Before and after:
BenchmarkTrimSpace  20000000   81.3 ns/op
BenchmarkTrimSpace  50000000   58.0 ns/op

(most whitespace trimming is ASCII whitespace)

Same optimization appeared a handful of other places
in this file, but not here.

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

12 years agocmd/8g: add a few missing splitclean
Russ Cox [Thu, 7 Feb 2013 22:55:25 +0000 (17:55 -0500)]
cmd/8g: add a few missing splitclean

Fixes #887.

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

12 years agocrypto/md5: fix for big-endian processors
Ian Lance Taylor [Thu, 7 Feb 2013 21:31:53 +0000 (13:31 -0800)]
crypto/md5: fix for big-endian processors

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

12 years agonet: skip TestMulticastListener on Solaris
Ian Lance Taylor [Thu, 7 Feb 2013 17:58:42 +0000 (09:58 -0800)]
net: skip TestMulticastListener on Solaris

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

12 years agoos/exec: LookPath on Unix shouldn't look in cwd when PATH is empty
Péter Surányi [Thu, 7 Feb 2013 14:41:35 +0000 (06:41 -0800)]
os/exec: LookPath on Unix shouldn't look in cwd when PATH is empty

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

12 years agocrypto/rc4: naïve ARM assembly implementation
Shenghou Ma [Thu, 7 Feb 2013 10:54:21 +0000 (18:54 +0800)]
crypto/rc4: naïve ARM assembly implementation

On 800MHz Cortex-A8:
benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         9395         2838  -69.79%
BenchmarkRC4_1K         74497        22120  -70.31%
BenchmarkRC4_8K        587243       171435  -70.81%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        13.62        45.09    3.31x
BenchmarkRC4_1K         13.75        46.29    3.37x
BenchmarkRC4_8K         13.79        47.22    3.42x

Result for "OpenSSL 1.0.1c 10 May 2012" from Debian/armhf sid:
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
rc4              39553.81k    46522.39k    49336.11k    50085.63k    50258.06k

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

12 years agonet: permit pollster DelFD to return whether to call Wakeup
Ian Lance Taylor [Thu, 7 Feb 2013 01:18:53 +0000 (17:18 -0800)]
net: permit pollster DelFD to return whether to call Wakeup

This is necessary for systems that use select as the pollster,
such as Solaris (supported by gccgo).  It corresponds to the
bool returned by AddFD.  In general it's not clearly defined
what happens when a descriptor used in a select is closed, and
different systems behave differently.  Waking up the select
will cause the right thing to happen: the closed descriptor
will be dropped from the next iteration.

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

12 years agosync: improve WaitGroup example by putting the call to Done in a
Gaal Yahas [Wed, 6 Feb 2013 16:39:52 +0000 (00:39 +0800)]
sync: improve WaitGroup example by putting the call to Done in a
deferred block. This makes hangs in the waiting code less likely
if a goroutine exits abnormally.

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

12 years agoCONTRIBUTORS: add Gaal Yahas (Google CLA)
Ian Lance Taylor [Wed, 6 Feb 2013 16:21:03 +0000 (08:21 -0800)]
CONTRIBUTORS: add Gaal Yahas (Google CLA)

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

12 years agosyscall, net: Fix unix socket autobind on Linux.
Albert Strasheim [Wed, 6 Feb 2013 14:45:57 +0000 (06:45 -0800)]
syscall, net: Fix unix socket autobind on Linux.

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

12 years agoexp/cookiejar: infrastructure for upcoming implementation
Volker Dobler [Wed, 6 Feb 2013 11:37:34 +0000 (22:37 +1100)]
exp/cookiejar: infrastructure for upcoming implementation

This CL is the first of a handful of CLs which will provide
the implementation of cookiejar. It contains several helper
functions and the skeleton of Cookies and SetCookies.

Proper host name handling requires the ToASCII transformation
from package idna which currently lives in the go.net
subrepo. This CL thus contains just a TODO for this issue.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7287046

12 years agodoc/articles/error_handling: no more os.Error
Shenghou Ma [Wed, 6 Feb 2013 10:32:54 +0000 (18:32 +0800)]
doc/articles/error_handling: no more os.Error

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

12 years agoruntime/race: switch to explicit race context instead of goroutine id's
Dmitriy Vyukov [Wed, 6 Feb 2013 07:40:54 +0000 (11:40 +0400)]
runtime/race: switch to explicit race context instead of goroutine id's
Removes limit on maximum number of goroutines ever existed.
code.google.com/p/goexecutor tests now pass successfully.
Also slightly improves performance.
Before: $ time ./flate.test -test.short
real 0m9.314s
After:  $ time ./flate.test -test.short
real 0m8.958s
Fixes #4286.
The runtime is built from llvm rev 174312.

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

12 years agolog/syslog: retry once if write fails
Jeff R. Allen [Tue, 5 Feb 2013 17:54:01 +0000 (09:54 -0800)]
log/syslog: retry once if write fails

Implements deferred connections + single-attempt automatic
retry. Based on CL 5078042 from kuroneko.

Fixes #2264.

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

12 years agoruntime: save LR to stack when panicking to handle leaf function traceback
Shenghou Ma [Tue, 5 Feb 2013 17:18:37 +0000 (01:18 +0800)]
runtime: save LR to stack when panicking to handle leaf function traceback

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

12 years agolib9: fix build for windows
Shenghou Ma [Tue, 5 Feb 2013 16:33:25 +0000 (00:33 +0800)]
lib9: fix build for windows

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