]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogo/types: clean up after test
Russ Cox [Thu, 13 Oct 2011 16:17:08 +0000 (12:17 -0400)]
go/types: clean up after test

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

13 years agoemacs: add a "godoc" command, like M-x man
Evan Martin [Thu, 13 Oct 2011 16:07:42 +0000 (09:07 -0700)]
emacs: add a "godoc" command, like M-x man

This runs godoc and displays its output in a new buffer.

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

13 years agodoc: minor homepage tweak
Brad Fitzpatrick [Thu, 13 Oct 2011 16:03:24 +0000 (09:03 -0700)]
doc: minor homepage tweak

Don't imply that the tour isn't browser-based.

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

13 years agogc: pass FlagNoPointers to runtime.new
Dmitriy Vyukov [Thu, 13 Oct 2011 08:06:55 +0000 (11:06 +0300)]
gc: pass FlagNoPointers to runtime.new

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

13 years agodoc: remove link to http://golanguage.ru/
Dmitriy Vyukov [Thu, 13 Oct 2011 07:09:43 +0000 (10:09 +0300)]
doc: remove link to http://golanguage.ru/
I check it for several months and it always says
ERR_NAME_RESOLUTION_FAILED

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

13 years agopkg: fix incorrect prints found by govet
Robert Hencke [Thu, 13 Oct 2011 02:34:01 +0000 (13:34 +1100)]
pkg: fix incorrect prints found by govet

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

13 years agoimage/tiff: Implement PackBits decoding.
Benny Siegert [Thu, 13 Oct 2011 02:31:26 +0000 (13:31 +1100)]
image/tiff: Implement PackBits decoding.

The decompression routine is in its own file because
G3 encoding (which is more complicated) will be put
there.

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

13 years agohtml: insert implied <p> and </p> tags
Andrew Balholm [Thu, 13 Oct 2011 01:40:48 +0000 (12:40 +1100)]
html: insert implied <p> and </p> tags

(test # 25 in tests1.dat)
#data
<p><b><div></p></b></div>X
#document
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|
|           <p>
|           "X"

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

13 years agohtml: when a parse test fails, don't bother testing rendering.
Nigel Tao [Thu, 13 Oct 2011 00:53:15 +0000 (11:53 +1100)]
html: when a parse test fails, don't bother testing rendering.

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

13 years agogotest: correct the documentation of -parallel.
Rob Pike [Wed, 12 Oct 2011 23:56:39 +0000 (16:56 -0700)]
gotest: correct the documentation of -parallel.
It said the default was zero, but it's actually $GOMAXPROCS.

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

13 years agofmt: remove an obsolete reference to os.ErrorString in a comment
Rob Pike [Wed, 12 Oct 2011 20:50:08 +0000 (13:50 -0700)]
fmt: remove an obsolete reference to os.ErrorString in a comment

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

13 years agoupdates: append(y,[]byte(z)...) -> append(y,z...)"
Christopher Wedgwood [Wed, 12 Oct 2011 20:42:04 +0000 (13:42 -0700)]
updates: append(y,[]byte(z)...) -> append(y,z...)"

(more are possible but omitted for now as they are part of
specific tests where rather than changing what is there we
should probably expand the tests to cover the new case)

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

13 years agogo/typechecker: delete per Go 1 plan
Robert Griesemer [Wed, 12 Oct 2011 20:07:55 +0000 (13:07 -0700)]
go/typechecker: delete per Go 1 plan

(go/types will be future replacement)

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

13 years agohttp: remove Request.RawURL
Brad Fitzpatrick [Wed, 12 Oct 2011 18:48:25 +0000 (11:48 -0700)]
http: remove Request.RawURL

Its purpose is not only undocumented, it's also unknown (to me
and Russ, at least) and leads to complexity, bugs and
confusion.

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

13 years agonetchan: move to old/netchan
Rob Pike [Wed, 12 Oct 2011 18:46:50 +0000 (11:46 -0700)]
netchan: move to old/netchan
Part of Go version 1 rearrangement.
No gofix, since the new name is not in Go 1.

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

13 years agocatch future accidental dependencies to exp/ or old/
Brad Fitzpatrick [Wed, 12 Oct 2011 17:55:42 +0000 (10:55 -0700)]
catch future accidental dependencies to exp/ or old/

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

13 years agogodoc: setup script for app engine, cleanups
Robert Griesemer [Wed, 12 Oct 2011 17:48:38 +0000 (10:48 -0700)]
godoc: setup script for app engine, cleanups

- automated app-engine setup with bash script
- added README.godoc-app
- removed orphaned files in misc/godoc

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

13 years agonet: Return error from CloseRead and CloseWrite.
Albert Strasheim [Wed, 12 Oct 2011 17:45:25 +0000 (13:45 -0400)]
net: Return error from CloseRead and CloseWrite.

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

13 years agonet: fix "unexpected socket family" error from WriteToUDP.
Albert Strasheim [Wed, 12 Oct 2011 17:36:45 +0000 (13:36 -0400)]
net: fix "unexpected socket family" error from WriteToUDP.

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

13 years agoruntime: fix memory leak in parallel garbage collector
Russ Cox [Wed, 12 Oct 2011 17:23:34 +0000 (13:23 -0400)]
runtime: fix memory leak in parallel garbage collector

The work buffer management used by the garbage
collector during parallel collections leaks buffers.
This CL tests for and fixes the leak.

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

13 years agoruntime: faster strings
Dmitriy Vyukov [Wed, 12 Oct 2011 14:40:02 +0000 (17:40 +0300)]
runtime: faster strings
Use FlagNoPointers and do not zeroize memory when allocate strings.
test/garbage/parser.out        old         new
run #1                     32.923s     32.065s
run #2                     33.047s     31.931s
run #3                     32.702s     31.841s
run #4                     32.718s     31.838s
run #5                     32.702s     31.868s

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

13 years agoruntime: append([]byte, string...)
Luuk van Dijk [Wed, 12 Oct 2011 13:59:23 +0000 (15:59 +0200)]
runtime: append([]byte, string...)

Fixes #2274

R=rsc, gri, dsymonds, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5149045

13 years agogo/scanner: remove AllowIllegalChars mode
Robert Griesemer [Wed, 12 Oct 2011 05:28:56 +0000 (22:28 -0700)]
go/scanner: remove AllowIllegalChars mode

This mode was needed before for clients of
the go/scanner that were parsing non-Go code.
All those clients have been moved to scanner
or have been deleted from the library.

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

13 years agogofmt: fix a couple of crashes, disallow rewrites for incomplete programs
Robert Griesemer [Wed, 12 Oct 2011 04:49:53 +0000 (21:49 -0700)]
gofmt: fix a couple of crashes, disallow rewrites for incomplete programs

The current implementation of formatting for incomplete programs
cannot tolerate program rewrites; ignore -rewrite in that case
with a warning message (temporary solution).

Fix a couple of crashes that were introduced recently.

Fixes #2348.

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

13 years agoexp/datafmt: delete per Go 1 plan
Robert Griesemer [Wed, 12 Oct 2011 00:52:37 +0000 (17:52 -0700)]
exp/datafmt: delete per Go 1 plan

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

13 years agoebnf, ebnflint: move under exp
Robert Griesemer [Wed, 12 Oct 2011 00:43:10 +0000 (17:43 -0700)]
ebnf, ebnflint: move under exp

pkg/ebnf -> pkg/exp/ebnf
cmd/ebnflint -> pkg/exp/ebnflint

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

13 years agoexp/spdy: move http/spdy to exp/spdy
Brad Fitzpatrick [Tue, 11 Oct 2011 23:45:01 +0000 (16:45 -0700)]
exp/spdy: move http/spdy to exp/spdy

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

13 years agocontainer/vector: delete
Rob Pike [Tue, 11 Oct 2011 23:41:48 +0000 (16:41 -0700)]
container/vector: delete
Slices are better:
http://code.google.com/p/go-wiki/wiki/SliceTricks

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

13 years agonet: implement ip protocol name to number resolver for windows
Alex Brainman [Tue, 11 Oct 2011 23:29:22 +0000 (10:29 +1100)]
net: implement ip protocol name to number resolver for windows

Fixes #2215.
Fixes #2216.

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

13 years agotry: delete
Rob Pike [Tue, 11 Oct 2011 23:17:21 +0000 (16:17 -0700)]
try: delete
A fun experiment but not carrying its weight.

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

13 years agosyscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go
Dave Cheney [Tue, 11 Oct 2011 19:47:00 +0000 (15:47 -0400)]
syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go

Fixes #1998.

ztypes_linux_arm.go has been regenerated on an arm5 debian sid host and
includes a few new constants.

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

13 years agogodoc: show source code if -src flag is set in command-line mode
Robert Griesemer [Tue, 11 Oct 2011 18:47:24 +0000 (11:47 -0700)]
godoc: show source code if -src flag is set in command-line mode

This also shows the source code of exported functions in server
mode (e.g. pkg/big/?m=src).

Fixes #2360.

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

13 years agocrypto/tls: add 3DES ciphersuites
Louis Kruger [Tue, 11 Oct 2011 17:07:32 +0000 (13:07 -0400)]
crypto/tls: add 3DES ciphersuites

The following ciphersuites are added:
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
This change helps conform to the TLS1.1 standard because
the first ciphersuite is "mandatory" in RFC4346

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

13 years agoCONTRIBUTORS: add Louis Kruger (Google CLA)
Russ Cox [Tue, 11 Oct 2011 17:07:01 +0000 (13:07 -0400)]
CONTRIBUTORS: add Louis Kruger (Google CLA)

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

13 years agoruntime: fix crash when returning from syscall during gc
Hector Chu [Tue, 11 Oct 2011 16:57:16 +0000 (12:57 -0400)]
runtime: fix crash when returning from syscall during gc

gp->m can go from non-nil to nil when it re-enters schedule().

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

13 years agonet: fix socket leak in case of Dial failure
Chris Farmiloe [Tue, 11 Oct 2011 16:53:16 +0000 (12:53 -0400)]
net: fix socket leak in case of Dial failure

Socket descriptors are not closed when fd.connect() fails during generic socket creation.
After a connection failure [ECONNREFUSED] descriptors are left in SYN_SENT state indefinitely (unless they get an explicit RST). Repeated failed connections will eventually cause your program to hit the user/system max-open-files limit.

Fixes #2349.

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

13 years agofmt: fix doc typo
Brad Fitzpatrick [Tue, 11 Oct 2011 15:49:09 +0000 (08:49 -0700)]
fmt: fix doc typo

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

13 years agogodoc: support multiple examples
Andrew Gerrand [Tue, 11 Oct 2011 00:11:47 +0000 (11:11 +1100)]
godoc: support multiple examples
gotest: document examples
go/doc: tidy comment

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

13 years agogob: avoid one copy for every message written.
Rob Pike [Mon, 10 Oct 2011 19:38:49 +0000 (12:38 -0700)]
gob: avoid one copy for every message written.
Plus the need for a second in-memory buffer.
Plays a bit fast and loose with the contents of a byte buffer,
but saves a potentially huge allocation. The gotest
run is about 10% faster overall after this change.

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

13 years agoA+C: Chris Farmiloe (individual CLA)
Mikio Hara [Mon, 10 Oct 2011 11:48:24 +0000 (20:48 +0900)]
A+C: Chris Farmiloe (individual CLA)

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

13 years agohtml: add a Render function.
Nigel Tao [Mon, 10 Oct 2011 03:44:37 +0000 (14:44 +1100)]
html: add a Render function.

R=mikesamuel, andybalholm
CC=golang-dev
https://golang.org/cl/5218041

13 years agohttp: cancel test timers; don't t.Fatalf in other goroutines
Brad Fitzpatrick [Mon, 10 Oct 2011 00:57:31 +0000 (17:57 -0700)]
http: cancel test timers; don't t.Fatalf in other goroutines

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

13 years agodoc: fix tutorial and Makefile PATH without dot
Andrew Gerrand [Mon, 10 Oct 2011 00:16:04 +0000 (11:16 +1100)]
doc: fix tutorial and Makefile PATH without dot

Fixes #2351.

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

13 years agodashboard: include last 100 lines in build failure mail
Andrew Gerrand [Sat, 8 Oct 2011 19:50:21 +0000 (06:50 +1100)]
dashboard: include last 100 lines in build failure mail

R=golang-dev, rsc, iant, robert.hencke
CC=golang-dev
https://golang.org/cl/5235041

13 years agogc: changes to export format in preparation for inlining.
Luuk van Dijk [Sat, 8 Oct 2011 17:37:06 +0000 (19:37 +0200)]
gc: changes to export format in preparation for inlining.

string literals used as package qualifiers are now prefixed with '@'
which obviates the need for the extra ':' before tags.

R=rsc, gri, lvd
CC=golang-dev
https://golang.org/cl/5129057

13 years agocrypto/tls: forgot this file in the last change.
Adam Langley [Sat, 8 Oct 2011 14:11:38 +0000 (10:11 -0400)]
crypto/tls: forgot this file in the last change.

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

13 years agocrypto/tls: add server side SNI support.
Adam Langley [Sat, 8 Oct 2011 14:06:53 +0000 (10:06 -0400)]
crypto/tls: add server side SNI support.

With this in place, a TLS server is capable of selecting the correct
certificate based on the client's ServerNameIndication extension.

The need to call Config.BuildNameToCertificate is unfortunate, but
adding a sync.Once to the Config structure made it uncopyable and I
felt that was too high a price to pay. Parsing the leaf certificates
in each handshake was too inefficient to consider.

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

13 years agoruntime: improve locking on openbsd
Joel Sing [Sat, 8 Oct 2011 13:56:13 +0000 (00:56 +1100)]
runtime: improve locking on openbsd

Implement a locking model based on the current linux model - a
tri-state mutex with active spinning, passive spinning and sleeping.

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

13 years agogofmt: update test.sh
Robert Griesemer [Fri, 7 Oct 2011 22:14:37 +0000 (15:14 -0700)]
gofmt: update test.sh

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

13 years agotesting: fix time reported for failing tests.
Rob Pike [Fri, 7 Oct 2011 21:15:16 +0000 (14:15 -0700)]
testing: fix time reported for failing tests.
t.ns was hanging after recent changes.

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

13 years agogodoc: show "unexported" declarations when executing "godoc builtin"
Robert Griesemer [Fri, 7 Oct 2011 19:45:19 +0000 (12:45 -0700)]
godoc: show "unexported" declarations when executing "godoc builtin"

Was never working correctly when executing from the command-line.

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

13 years agogo/token: remove obsolete comment (cleanup)
Robert Griesemer [Fri, 7 Oct 2011 15:54:02 +0000 (08:54 -0700)]
go/token: remove obsolete comment (cleanup)

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

13 years agonet: add File method to IPConn
Mikio Hara [Fri, 7 Oct 2011 13:53:12 +0000 (22:53 +0900)]
net: add File method to IPConn

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

13 years agoutf8: add Valid and ValidString
Brad Fitzpatrick [Fri, 7 Oct 2011 05:47:24 +0000 (22:47 -0700)]
utf8: add Valid and ValidString

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

13 years agogodoc: use scanner instead of go/scanner for ebnf processing of spec
Robert Griesemer [Fri, 7 Oct 2011 04:46:05 +0000 (21:46 -0700)]
godoc: use scanner instead of go/scanner for ebnf processing of spec

Also: Fewer calls to flush for faster processing (once per identifier
or error instead of once per token).

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

13 years agoimage: delete obsolete color.go
Nigel Tao [Fri, 7 Oct 2011 02:33:34 +0000 (13:33 +1100)]
image: delete obsolete color.go

I accidentally left it off of https://golang.org/cl/5132048/.

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

13 years agogo/token: document deserialization property
Robert Griesemer [Fri, 7 Oct 2011 00:37:59 +0000 (17:37 -0700)]
go/token: document deserialization property

FileSet deserialization (Read) uses its own instance of a gob decoder.
If the FileSet data may be followed by other data on the reader, Read
may consume too much data that is lost unless the reader implements
ReadByte.

Also: Minor internal refactoring for symmetry.

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

13 years agogodoc: use a bufio.Buffer to read search index
Robert Griesemer [Fri, 7 Oct 2011 00:36:00 +0000 (17:36 -0700)]
godoc: use a bufio.Buffer to read search index

Also: Minor refactoring for cleanliness and symmetry.

Fixes #2286.

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

13 years agogo/ast: don't remove function bodies when filtering exports
Robert Griesemer [Thu, 6 Oct 2011 23:07:56 +0000 (16:07 -0700)]
go/ast: don't remove function bodies when filtering exports

This is a semantic but no API change. It is a cleaner
implementation of pure filtering. Applications that
need function bodies stripped can easily do this them-
selves.

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

13 years agogodoc: documentation for all (not just exported) declarations
Robert Griesemer [Thu, 6 Oct 2011 23:06:23 +0000 (16:06 -0700)]
godoc: documentation for all (not just exported) declarations

Removed the URL form parameter "f=text" in favor of a more
flexible mode parameter "m" which now accepts a list of mode
flags as documented in doc.go.

Fixes #1784.

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

13 years agotag weekly.2011-10-06
Andrew Gerrand [Thu, 6 Oct 2011 23:01:57 +0000 (16:01 -0700)]
tag weekly.2011-10-06

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

13 years agoweekly.2011-10-06 weekly.2011-10-06
Andrew Gerrand [Thu, 6 Oct 2011 22:56:02 +0000 (15:56 -0700)]
weekly.2011-10-06

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

13 years agotemplate: fix comments with different delimiters.
Rob Pike [Thu, 6 Oct 2011 22:21:56 +0000 (15:21 -0700)]
template: fix comments with different delimiters.

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

13 years agotemplate: add method Delims to allow alternate action delimiters.
Rob Pike [Thu, 6 Oct 2011 20:30:50 +0000 (13:30 -0700)]
template: add method Delims to allow alternate action delimiters.

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

13 years agodoc: remove errant console.log from godocs.js
Andrew Gerrand [Thu, 6 Oct 2011 20:12:11 +0000 (13:12 -0700)]
doc: remove errant console.log from godocs.js

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

13 years agogo/doc, godoc, gotest: support for reading example documentation
Andrew Gerrand [Thu, 6 Oct 2011 18:56:17 +0000 (11:56 -0700)]
go/doc, godoc, gotest: support for reading example documentation

This CL introduces the go.Example type and go.Examples functions that
are used to represent and extract code samples from Go source.

They should be of the form:

// Output of this function.
func ExampleFoo() {
        fmt.Println("Output of this function.")
}

It also modifies godoc to read example code from _test.go files,
and include them in the HTML output with JavaScript-driven toggles.

It also implements testing of example functions with gotest.
The stdout/stderr is compared against the output comment on the
function.

This CL includes examples for the sort.Ints function and the
sort.SortInts type. After patching this CL in and re-building go/doc
and godoc, try
        godoc -http=localhost:6060
and visit http://localhost:6060/pkg/sort/

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

13 years agoexec: add Command.ExtraFiles
Brad Fitzpatrick [Thu, 6 Oct 2011 18:00:02 +0000 (11:00 -0700)]
exec: add Command.ExtraFiles

Allows passing extra fds to the child process.

Fixes #2329

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

13 years agoEffective Go: IntArray -> IntSlice
Rob Pike [Thu, 6 Oct 2011 17:46:18 +0000 (10:46 -0700)]
Effective Go: IntArray -> IntSlice
Fixes #2336.

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

13 years agogotest: document -test.parallel
Rob Pike [Thu, 6 Oct 2011 17:41:52 +0000 (10:41 -0700)]
gotest: document -test.parallel

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

13 years agotesting: Add support for running tests in parallel (t.Parallel API).
Miki Tebeka [Thu, 6 Oct 2011 16:58:36 +0000 (09:58 -0700)]
testing: Add support for running tests in parallel (t.Parallel API).

See discussion at https://groups.google.com/d/topic/golang-dev/RAKiqi44GEU/discussion

R=golang-dev, bradfitz, dvyukov, rogpeppe, r, r, borman
CC=golang-dev
https://golang.org/cl/5071044

13 years agoC+A: Miki Tebeka miki.tebeka@gmail.com
Rob Pike [Thu, 6 Oct 2011 16:54:39 +0000 (09:54 -0700)]
C+A: Miki Tebeka miki.tebeka@gmail.com

R=golang-dev, gri
CC=golang-dev, miki.tebeka
https://golang.org/cl/5225042

13 years agoruntime: faster finalizers
Dmitriy Vyukov [Thu, 6 Oct 2011 15:42:51 +0000 (18:42 +0300)]
runtime: faster finalizers

Linux/amd64, 2 x Intel Xeon E5620, 8 HT cores, 2.40GHz
benchmark                    old ns/op    new ns/op    delta
BenchmarkFinalizer              420.00       261.00  -37.86%
BenchmarkFinalizer-2            985.00       201.00  -79.59%
BenchmarkFinalizer-4           1077.00       244.00  -77.34%
BenchmarkFinalizer-8           1155.00       180.00  -84.42%
BenchmarkFinalizer-16          1182.00       184.00  -84.43%

BenchmarkFinalizerRun          2128.00      1378.00  -35.24%
BenchmarkFinalizerRun-2        1655.00      1418.00  -14.32%
BenchmarkFinalizerRun-4        1634.00      1522.00   -6.85%
BenchmarkFinalizerRun-8        2213.00      1581.00  -28.56%
BenchmarkFinalizerRun-16       2424.00      1599.00  -34.03%

Darwin/amd64, Intel L9600, 2 cores, 2.13GHz
benchmark                    old ns/op    new ns/op    delta
BenchmarkChanCreation          1451.00       926.00  -36.18%
BenchmarkChanCreation-2        3124.00      1412.00  -54.80%
BenchmarkChanCreation-4        6121.00      2628.00  -57.07%

BenchmarkFinalizer              684.00       420.00  -38.60%
BenchmarkFinalizer-2          11195.00       398.00  -96.44%
BenchmarkFinalizer-4          15862.00       654.00  -95.88%

BenchmarkFinalizerRun          2025.00      1397.00  -31.01%
BenchmarkFinalizerRun-2        3920.00      1447.00  -63.09%
BenchmarkFinalizerRun-4        9471.00      1545.00  -83.69%

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

13 years agoruntime: fix malloc sampling bug
Russ Cox [Thu, 6 Oct 2011 15:30:48 +0000 (11:30 -0400)]
runtime: fix malloc sampling bug

The malloc sample trigger was not being set in a
new m, so the first allocation in each new m - the
goroutine structure - was being sampled with
probability 1 instead of probability sizeof(G)/rate,
an oversampling of about 5000x for the default
rate of 1 MB.  This bug made pprof graphs show
far more G allocations than there actually were.

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

13 years agoruntime: fix spurious deadlock reporting
Dmitriy Vyukov [Thu, 6 Oct 2011 15:10:14 +0000 (18:10 +0300)]
runtime: fix spurious deadlock reporting
Fixes #2337.
Unfortunate sequence of events is:
1. maxcpu=2, mcpu=1, grunning=1
2. starttheworld creates an extra M:
   maxcpu=2, mcpu=2, grunning=1
4. the goroutine calls runtime.GOMAXPROCS(1)
   maxcpu=1, mcpu=2, grunning=1
5. since it sees mcpu>maxcpu, it calls gosched()
6. schedule() deschedules the goroutine:
   maxcpu=1, mcpu=1, grunning=0
7. schedule() call getnextandunlock() which
   fails to pick up the goroutine again,
   because canaddcpu() fails, because mcpu==maxcpu
8. then it sees that grunning==0,
   reports deadlock and terminates

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

13 years agobuild: clear execute bit from source files
Mikio Hara [Thu, 6 Oct 2011 09:33:13 +0000 (18:33 +0900)]
build: clear execute bit from source files

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

13 years agocgo: support for mingw-w64 4.5.1 and newer
Wei Guangjing [Thu, 6 Oct 2011 06:22:48 +0000 (07:22 +0100)]
cgo: support for mingw-w64 4.5.1 and newer

R=rsc, jp, hectorchu
CC=golang-dev
https://golang.org/cl/4962051

13 years agoexp/norm: LastBoundary is used in preparation for an append operation. It seems
Marcel van Lohuizen [Wed, 5 Oct 2011 21:36:02 +0000 (14:36 -0700)]
exp/norm: LastBoundary is used in preparation for an append operation. It seems
therefore unlikely that there is a good use for its string version
LastBoundaryInString. Yet, the implemenation of this method would complicate
things a bit as it would require the introduction for another interface and
some duplication of code. Removing it seems a better choice.

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

13 years agotag release.r60.2
Andrew Gerrand [Wed, 5 Oct 2011 21:33:18 +0000 (14:33 -0700)]
tag release.r60.2

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

13 years agodoc: document r60.2
Andrew Gerrand [Wed, 5 Oct 2011 20:59:39 +0000 (13:59 -0700)]
doc: document r60.2

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

13 years agoencoding/binary: added benchmarks
Robert Griesemer [Wed, 5 Oct 2011 20:04:43 +0000 (13:04 -0700)]
encoding/binary: added benchmarks

binary.BenchmarkPutUvarint32 20000000  85.6 ns/op
binary.BenchmarkPutUvarint64 10000000 299   ns/op

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

13 years agodoc: link to Czech translation of The Laws of Reflection
Andrew Gerrand [Wed, 5 Oct 2011 19:45:56 +0000 (12:45 -0700)]
doc: link to Czech translation of The Laws of Reflection

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

13 years agodoc: link to A Tour of Go
Andrew Gerrand [Wed, 5 Oct 2011 18:12:07 +0000 (11:12 -0700)]
doc: link to A Tour of Go

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

13 years agowebsocket: add hybi-13 support
Fumitoshi Ukai [Wed, 5 Oct 2011 17:50:29 +0000 (10:50 -0700)]
websocket: add hybi-13 support

Major changes between hybi-08 and hybi-13
- hybi-08 uses Sec-WebSocket-Origin, but hybi-13 uses Origin
- hybi-13 introduces new close status codes.

hybi-17 spec (editorial changes of hybi-13) mentions
- if a server doesn't support the requested version, it MUST respond
  with Sec-WebSocket-Version headers containing all available versions.
- client MUST close the connection upon receiving a masked frame
- server MUST close the connection upon receiving a non-masked frame
note that hybi-17 still uses "Sec-WebSocket-Version: 13"

see http://code.google.com/p/pywebsocket/wiki/WebSocketProtocolSpec
for changes between spec drafts.

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

13 years agodocumentation: Debugging Go code with GDB tutorial.
Luuk van Dijk [Wed, 5 Oct 2011 17:49:23 +0000 (10:49 -0700)]
documentation: Debugging Go code with GDB tutorial.

R=adg, cw, lvd
CC=golang-dev
https://golang.org/cl/5168046

13 years agoexp/norm: introduced input interface to implement string versions
Marcel van Lohuizen [Wed, 5 Oct 2011 17:44:11 +0000 (10:44 -0700)]
exp/norm: introduced input interface to implement string versions
of methods.

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

13 years agoebnf: use scanner instead of go/scanner
Robert Griesemer [Wed, 5 Oct 2011 17:34:01 +0000 (10:34 -0700)]
ebnf: use scanner instead of go/scanner

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

13 years agoruntime: set runtime ncpu on openbsd
Joel Sing [Wed, 5 Oct 2011 17:16:43 +0000 (13:16 -0400)]
runtime: set runtime ncpu on openbsd

Set the runtime ncpu based on the hw.ncpu sysctl.

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

13 years agogob: when possible, allow sequential decoders on the same input stream.
Rob Pike [Wed, 5 Oct 2011 16:47:09 +0000 (09:47 -0700)]
gob: when possible, allow sequential decoders on the same input stream.
This can work only if there is no type info required to initialize the decoder,
but it's easy and gains a few percent in the basic benchmarks by avoiding
bufio when it's a bytes.Buffer - a testing-only scenario, I admit.
Add a comment about what Decode expects from the input.

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

13 years agomisc/emacs: fix indent bug
Russ Cox [Wed, 5 Oct 2011 16:27:23 +0000 (12:27 -0400)]
misc/emacs: fix indent bug

Must use case-sensitive search to identify keywords.

Fixes #2287.

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

13 years agocodereview: fix for Mercurial 1.9.2
Russ Cox [Wed, 5 Oct 2011 16:08:41 +0000 (12:08 -0400)]
codereview: fix for Mercurial 1.9.2

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

13 years agogc: limit helper threads based on ncpu
Joel Sing [Wed, 5 Oct 2011 16:08:28 +0000 (12:08 -0400)]
gc: limit helper threads based on ncpu

When ncpu < 2, work.nproc is always 1 which results in infinite helper
threads being created if gomaxprocs > 1 and MaxGcproc > 1. Avoid this
by using the same limits as imposed helpgc().

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

13 years agoruntime: fix Plan 9 build
Anthony Martin [Wed, 5 Oct 2011 16:07:44 +0000 (12:07 -0400)]
runtime: fix Plan 9 build

This change adds the osyield and usleep
functions and code to read the number of
processors from /dev/sysstat.

I also changed SysAlloc to return nil
when brk fails (it was returning -1).

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

13 years agocodereview: fix hg change in Windows console
Yasuhiro Matsumoto [Wed, 5 Oct 2011 16:07:13 +0000 (12:07 -0400)]
codereview: fix hg change in Windows console

lib/codereview: Unable to use vim for 'hg change' from windows console
reload(sys) break workaround for windows.
see:
http://mercurial.selenic.com/bts/issue2888
http://mercurial.selenic.com/bts/issue1452
Also does not work with backslash paths.

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

13 years ago5l/6l/8l: add a DT_DEBUG dynamic tag to a dynamic ELF binary
Ian Lance Taylor [Wed, 5 Oct 2011 04:25:11 +0000 (21:25 -0700)]
5l/6l/8l: add a DT_DEBUG dynamic tag to a dynamic ELF binary

This requires making the .dynamic section writable, as the
dynamic linker will change the value of the DT_DEBUG tag at
runtime.  The DT_DEBUG tag is used by gdb to find all loaded
shared libraries.

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

13 years agopkg/syscall: add Mkfifo for linux platforms
Paul Borman [Tue, 4 Oct 2011 20:58:31 +0000 (13:58 -0700)]
pkg/syscall: add Mkfifo for linux platforms

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

13 years agowebsocket: better error message in a test
Brad Fitzpatrick [Tue, 4 Oct 2011 20:46:03 +0000 (13:46 -0700)]
websocket: better error message in a test

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

13 years agotime: make month/day name comparisons case insenstive
Paul Borman [Tue, 4 Oct 2011 19:52:30 +0000 (12:52 -0700)]
time: make month/day name comparisons case insenstive

Fixes #2324.

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

13 years ago5g, 6g, 8g: fix loop finding bug, squash jmps
Russ Cox [Tue, 4 Oct 2011 19:06:16 +0000 (15:06 -0400)]
5g, 6g, 8g: fix loop finding bug, squash jmps

The loop recognizer uses the standard dominance
frontiers but gets confused by dead code, which
has a (not explicitly set) rpo number of 0, meaning it
looks like the head of the function, so it dominates
everything.  If the loop recognizer encounters dead
code while tracking backward through the graph
it fails to recognize where it started as a loop, and
then the optimizer does not registerize values loaded
inside that loop.  Fix by checking rpo against rpo2r.

Separately, run a quick pass over the generated
code to squash JMPs to JMP instructions, which
are convenient to emit during code generation but
difficult to read when debugging the -S output.
A side effect of this pass is to eliminate dead code,
so the output files may be slightly smaller and the
optimizer may have less work to do.
There is no semantic effect, because the linkers
flatten JMP chains and delete dead instructions
when laying out the final code.  Doing it here too
just makes the -S output easier to read and more
like what the final binary will contain.

The "dead code breaks loop finding" bug is thus
fixed twice over.  It seemed prudent to fix loopit
separately just in case dead code ever sneaks back
in for one reason or another.

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

13 years agopath/filepath: added Rel as the complement of Abs
Gustavo Niemeyer [Tue, 4 Oct 2011 14:27:06 +0000 (11:27 -0300)]
path/filepath: added Rel as the complement of Abs

R=golang-dev, rsc, gustavo, r, borman
CC=golang-dev
https://golang.org/cl/4981049

13 years agocgo: allow Window's specific path characters in flag directives.
Joe Poirier [Tue, 4 Oct 2011 04:07:28 +0000 (15:07 +1100)]
cgo: allow Window's specific path characters in flag directives.

Example: #cgo windows LDFLAGS: -LC:\\WINDOWS\\system32

R=alex.brainman, go.peter.90, golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5154042