]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
13 years agorelease.2011-03-07 weekly.2011-03-07
Andrew Gerrand [Mon, 7 Mar 2011 02:55:22 +0000 (13:55 +1100)]
release.2011-03-07

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

13 years agoio/ioutil: use filepath.Join, handle trailing / in $TMPDIR
Russ Cox [Mon, 7 Mar 2011 02:52:37 +0000 (21:52 -0500)]
io/ioutil: use filepath.Join, handle trailing / in $TMPDIR

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

13 years agopath/filepath: disable test on windows to fix build
Alex Brainman [Mon, 7 Mar 2011 01:23:57 +0000 (12:23 +1100)]
path/filepath: disable test on windows to fix build

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4235054

13 years agomime/multipart: switch from map to MIMEHeader
Brad Fitzpatrick [Sun, 6 Mar 2011 23:12:03 +0000 (15:12 -0800)]
mime/multipart: switch from map to MIMEHeader

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

13 years agocgo: fix dwarf type parsing
Gustavo Niemeyer [Sun, 6 Mar 2011 23:05:57 +0000 (18:05 -0500)]
cgo: fix dwarf type parsing

The recursive algorithm used to parse types in cgo
has a bug related to building the C type representation.

As an example, when the recursion starts at a type *T,
the C type representation won't be known until type T
itself is parsed.  But then, it is possible that type T
references the type **T internally.  The latter
representation is built based on the one of *T, which
started the recursion, so it won't attempt to parse it
again, and will instead use the current representation
value for *T, which is still empty at this point.

This problem was fixed by introducing a simple TypeRepr
type which builds the string representation lazily,
analogous to how the Go type information is built within
the same algorithm.  This way, even if a type
representation is still unknown at some level in the
recursion, representations dependant on it can still
be created correctly.

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

13 years agopath/filepath: new OS-specific path support
Gustavo Niemeyer [Sun, 6 Mar 2011 22:33:23 +0000 (17:33 -0500)]
path/filepath: new OS-specific path support

The path package now contains only functions which
deal with slashed paths, sensible for any OS when dealing
with network paths or URLs.  OS-specific functionality
has been moved into the new path/filepath package.

This also includes fixes for godoc, goinstall and other
packages which were mixing slashed and OS-specific paths.

R=rsc, gri, mattn, brainman
CC=golang-dev
https://golang.org/cl/4252044

13 years agowebsocket: use httptest.Server for tests
Robert Hencke [Sun, 6 Mar 2011 22:05:12 +0000 (17:05 -0500)]
websocket: use httptest.Server for tests

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

13 years agobuild: remove old cgo files
Russ Cox [Sun, 6 Mar 2011 22:04:24 +0000 (17:04 -0500)]
build: remove old cgo files

Cgo changed to write these files into _obj, but some
trees may still have the old ones in the source directory.
They need to be removed during make clean so that
a subsequent build will use the ones in _obj.

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

13 years agohttp: add cookie support
Petar Maymounkov [Sun, 6 Mar 2011 20:02:06 +0000 (15:02 -0500)]
http: add cookie support

R=rsc1, mattn, bradfitzwork, pascal, bradfitzgo
CC=golang-dev
https://golang.org/cl/4214042

13 years agosyscall: work around FreeBSD execve kernel bug
Devon H. O'Dell [Sun, 6 Mar 2011 19:57:05 +0000 (14:57 -0500)]
syscall: work around FreeBSD execve kernel bug

FreeBSD's execve implementation has an integer underflow in a bounds test which
causes it to erroneously think the argument list is too long when argv[0] is
longer than interpreter + path.

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

13 years agogob: clean up getTypeInfo (address a TODO)
Rob Pike [Sun, 6 Mar 2011 18:50:07 +0000 (10:50 -0800)]
gob: clean up getTypeInfo (address a TODO)
also fix a caching bug.

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

13 years agohttp/cgi: skip test if perl or CGI.pm not available
Russ Cox [Sun, 6 Mar 2011 16:23:47 +0000 (11:23 -0500)]
http/cgi: skip test if perl or CGI.pm not available

R=bradfitzgo, bradfitzwork
CC=golang-dev
https://golang.org/cl/4264047

13 years agofmt: trivial cleanup
Robert Hencke [Sun, 6 Mar 2011 01:55:53 +0000 (17:55 -0800)]
fmt: trivial cleanup

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4235052

13 years agoA+C: Robert Hencke (individual CLA)
Brad Fitzpatrick [Sun, 6 Mar 2011 01:51:53 +0000 (17:51 -0800)]
A+C: Robert Hencke (individual CLA)

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

13 years agogob: don't send type information about unexported fields.
Rob Pike [Sun, 6 Mar 2011 00:05:35 +0000 (16:05 -0800)]
gob: don't send type information about unexported fields.

A change a while back stop sending data for unexported fields
but due to an oversight the type info was being sent also. It's
inconsequential but wrong to do that.

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

13 years agohttptest: fix docs out-of-sync from earlier renaming
Brad Fitzpatrick [Sat, 5 Mar 2011 23:43:26 +0000 (15:43 -0800)]
httptest: fix docs out-of-sync from earlier renaming

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

13 years agohttptest: introduce TempServer, clean up tests
Brad Fitzpatrick [Sat, 5 Mar 2011 21:51:35 +0000 (13:51 -0800)]
httptest: introduce TempServer, clean up tests

This also breaks fs_test into two parts
as the range tests test http's private httpRange
and I had to change the fs_test package from
"http" to "http_test" to use httptest which otherwise
has a cyclic depedency back on http.

Aside: we should start exposing the Range
stuff in the future.

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

13 years agobuild: avoid calling gomake wrapper in recursive make
Dave Cheney [Sat, 5 Mar 2011 19:53:29 +0000 (14:53 -0500)]
build: avoid calling gomake wrapper in recursive make

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

13 years agohttp: fixed race condition in persist.go
Petar Maymounkov [Sat, 5 Mar 2011 19:44:05 +0000 (14:44 -0500)]
http: fixed race condition in persist.go

R=rsc, bradfitzgo, bradfitzwork
CC=golang-dev
https://golang.org/cl/4266042

13 years agohttp: fix, use WriteProxy
Russ Cox [Sat, 5 Mar 2011 19:35:15 +0000 (14:35 -0500)]
http: fix, use WriteProxy

Fixes #53.

R=bradfitzgo, bradfitzwork
CC=golang-dev
https://golang.org/cl/4240075

13 years agocompress/flate: fix test
Russ Cox [Sat, 5 Mar 2011 19:35:03 +0000 (14:35 -0500)]
compress/flate: fix test

The test was checking for a buffer to be empty but
actually racing with the background goroutine that
was emptying it.  Left a comment so that the check
is not reintroduced later.

Fixes #1557.

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

13 years agocgo: use correct frame size for 0 arguments
Russ Cox [Sat, 5 Mar 2011 19:24:44 +0000 (14:24 -0500)]
cgo: use correct frame size for 0 arguments

Passing a frame size of 1 was causing the cgo callback
to push 1 byte of arguments onto the stack, making
the stack pointer misaligned, which had the effect of
hiding all the pointers on the stack from the garbage
collector.

SWIG only wraps calls to C++ virtual methods, so it
always has at least 1 argument, so SWIG does not need
to be fixed too.

Fixes #1328.

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

13 years agoA+C: Pascal S. de Kloe (individual CLA)
Russ Cox [Sat, 5 Mar 2011 19:24:26 +0000 (14:24 -0500)]
A+C: Pascal S. de Kloe (individual CLA)

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

13 years agogc, gopack: add some missing flags to the docs.
David Symonds [Sat, 5 Mar 2011 04:21:26 +0000 (20:21 -0800)]
gc, gopack: add some missing flags to the docs.

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

13 years agotime: split os-dependent part into sys.go.
David Symonds [Sat, 5 Mar 2011 03:57:39 +0000 (19:57 -0800)]
time: split os-dependent part into sys.go.

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

13 years agogob: enable the GobEncoder and GobDecoder interfaces.
Rob Pike [Fri, 4 Mar 2011 22:18:52 +0000 (14:18 -0800)]
gob: enable the GobEncoder and GobDecoder interfaces.
These allow data items to control their own representation.

For now, the implementation requires that the value passed
to Encode and Decode must be exactly the type of the
methods' receiver; it cannot be, for instance, T if the receiver
is of type *T.  This will be fixed in a later CL.

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

13 years agohttp/cgi: skip tests on Windows
Brad Fitzpatrick [Fri, 4 Mar 2011 22:12:39 +0000 (14:12 -0800)]
http/cgi: skip tests on Windows

The tests require Perl, not commonly installed on Windows.

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

13 years agoruntime: make printf work on misaligned stack
Russ Cox [Fri, 4 Mar 2011 20:42:39 +0000 (15:42 -0500)]
runtime: make printf work on misaligned stack

(Shouldn't happen, but if it does, it's useful to be
able to use printf to debug it.)

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

13 years agogob: beginning of support for GobEncoder/GobDecoder interfaces.
Rob Pike [Fri, 4 Mar 2011 20:25:18 +0000 (12:25 -0800)]
gob: beginning of support for GobEncoder/GobDecoder interfaces.

This allows a data item that can marshal itself to be transmitted by its
own encoding, enabling some types to be handled that cannot be
normally, plus providing a way to use gobs on data with unexported
fields.

In this CL, the necessary methods are protected by leading _, so only
package gob can use the facilities (in its tests, of course); this
code is not ready for real use yet.  I could be talked into enabling
it for experimentation, though.  The main drawback is that the
methods must be implemented by the actual type passed through,
not by an indirection from it.  For instance, if *T implements
GobEncoder, you must send a *T, not a T.  This will be addressed
in due course.

Also there is improved commentary and a couple of unrelated
minor bug fixes.

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

13 years agohttp: rename ClientTransport to Transport
Brad Fitzpatrick [Fri, 4 Mar 2011 19:41:57 +0000 (11:41 -0800)]
http: rename ClientTransport to Transport

http.Transport looks nicer, and ServerTransport
doesn't make much sense anyway.

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

13 years agohttp: add packages http/cgi and http/httptest
Brad Fitzpatrick [Fri, 4 Mar 2011 18:55:47 +0000 (10:55 -0800)]
http: add packages http/cgi and http/httptest

R=rsc, adg, jnw, bradfitzwork
CC=golang-dev
https://golang.org/cl/4247048

13 years agodoc: there's no such thing as a .cgo file
Andrew Gerrand [Fri, 4 Mar 2011 05:28:27 +0000 (16:28 +1100)]
doc: there's no such thing as a .cgo file

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

13 years agodoc: add "implements" question to FAQ
Andrew Gerrand [Fri, 4 Mar 2011 02:11:07 +0000 (13:11 +1100)]
doc: add "implements" question to FAQ

R=r, fw, gri, r2, yiyus
CC=golang-dev
https://golang.org/cl/4248051

13 years agodoc: describe platform-specific conventions in code.html
Andrew Gerrand [Fri, 4 Mar 2011 01:28:08 +0000 (12:28 +1100)]
doc: describe platform-specific conventions in code.html

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

13 years agogofmt: exclude test file that is not legal Go
Robert Griesemer [Fri, 4 Mar 2011 00:52:56 +0000 (16:52 -0800)]
gofmt: exclude test file that is not legal Go

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

13 years agogo spec: minor clarification of scope rule for functions
Robert Griesemer [Thu, 3 Mar 2011 23:24:28 +0000 (15:24 -0800)]
go spec: minor clarification of scope rule for functions

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

13 years agohttp: change localhost URL; maybe fix Windows
Brad Fitzpatrick [Thu, 3 Mar 2011 21:29:31 +0000 (13:29 -0800)]
http: change localhost URL; maybe fix Windows

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

13 years agohttp: allow handlers to send non-chunked responses
Brad Fitzpatrick [Thu, 3 Mar 2011 20:22:13 +0000 (12:22 -0800)]
http: allow handlers to send non-chunked responses

Currently all http handlers reply to HTTP/1.1 requests with
chunked responses.  This patch allows handlers to opt-out of
that behavior by pre-declaring their Content-Length (which is
then enforced) and unsetting their Transfer-Encoding or
setting it to the "identity" encoding.

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

13 years agoio/ioutil: add TempDir
Russ Cox [Thu, 3 Mar 2011 19:51:49 +0000 (14:51 -0500)]
io/ioutil: add TempDir

It's a little confusing that os.TempDir and ioutil.TempDir have
different meanings.  I don't know what to change the names to,
if anything.  At least they also have different signatures.

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

13 years agotesting: run GC before each benchmark run.
Roger Peppe [Thu, 3 Mar 2011 19:26:53 +0000 (11:26 -0800)]
testing: run GC before each benchmark run.

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

13 years agofmt: make recursive scan more efficient.
Roger Peppe [Thu, 3 Mar 2011 18:43:29 +0000 (10:43 -0800)]
fmt: make recursive scan more efficient.
Detect when scan is being called recursively and
re-use the same scan state.

On my machine, for a recursion-heavy benchmark, this
results in 44x speed up. This does impose a 4% penalty
on the non-recursive case, which can be removed by
heap-allocating the saved state, at 40% performance penalty
on the recursive case. Either way is fine with me.

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

13 years agoreflect: add PtrTo, add Value.Addr (old Addr is now UnsafeAddr)
Russ Cox [Thu, 3 Mar 2011 18:20:17 +0000 (13:20 -0500)]
reflect: add PtrTo, add Value.Addr (old Addr is now UnsafeAddr)

This change makes it possible to take the address of a
struct field or slice element in order to call a method that
requires a pointer receiver.

Existing code that uses the Value.Addr method will have
to change (as gob does in this CL) to call UnsafeAddr instead.

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

13 years agogc, ld: reflect support for PtrTo
Russ Cox [Thu, 3 Mar 2011 18:17:54 +0000 (13:17 -0500)]
gc, ld: reflect support for PtrTo

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

13 years agofix build (observed in wild, not on dashboard)
Russ Cox [Thu, 3 Mar 2011 16:51:16 +0000 (11:51 -0500)]
fix build (observed in wild, not on dashboard)

TBR=r
CC=golang-dev
https://golang.org/cl/4257054

13 years agobzip2: speed up decompression.
Adam Langley [Thu, 3 Mar 2011 14:13:06 +0000 (09:13 -0500)]
bzip2: speed up decompression.

This borrows a trick from the bzip2 source and effects a decent speed
up when decompressing highly compressed sources. Rather than unshuffle
the BTW block when performing the IBTW, a linked-list is threaded
through the array, in place. This improves cache hit rates.

R=bradfitzgo, bradfitzwork, cw
CC=golang-dev
https://golang.org/cl/4247047

13 years agoimage: add a decoding test for common file formats.
Nigel Tao [Thu, 3 Mar 2011 09:35:49 +0000 (20:35 +1100)]
image: add a decoding test for common file formats.

The test image was converted from doc/video-001.png using the
convert command line tool (ImageMagick 6.5.7-8) at -quality 100.

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

13 years agodoc: remove reference to bug count from install.html
Andrew Gerrand [Thu, 3 Mar 2011 05:41:03 +0000 (16:41 +1100)]
doc: remove reference to bug count from install.html

Fixes #1574.

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

13 years agogobuilder: add -package flag to build external packages
Andrew Gerrand [Thu, 3 Mar 2011 03:41:09 +0000 (14:41 +1100)]
gobuilder: add -package flag to build external packages

Also add -v for verbose logging.

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

13 years agounsafe: fix the documentation
Rob Pike [Thu, 3 Mar 2011 03:39:08 +0000 (19:39 -0800)]
unsafe: fix the documentation
Reflection is about Pointer, not uintptr.
Also clarify that Reflect and Unreflect are indirect.

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

13 years agogc: fix init of packages named main
Gustavo Niemeyer [Wed, 2 Mar 2011 21:18:17 +0000 (16:18 -0500)]
gc: fix init of packages named main

This change removes the special case which existed
for handling the initalization of the main package,
so that other modules named 'main' get properly
initialized when imported.

Note that gotest of main packages will break in most
cases without this.

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

13 years agoruntime: fix unused variable warning
Dave Cheney [Wed, 2 Mar 2011 20:29:13 +0000 (15:29 -0500)]
runtime: fix unused variable warning

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

13 years agoxml: fix typo in test.
Yasuhiro Matsumoto [Wed, 2 Mar 2011 20:05:52 +0000 (15:05 -0500)]
xml: fix typo in test.

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

13 years agogoinstall: protect against malicious filenames.
Roger Peppe [Wed, 2 Mar 2011 20:04:08 +0000 (15:04 -0500)]
goinstall: protect against malicious filenames.
It was possible to make package run arbitrary
commands when installing if its filenames contained
make metacharacters.

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

13 years agobuild: simplify clean.bash
Dave Cheney [Wed, 2 Mar 2011 19:57:47 +0000 (14:57 -0500)]
build: simplify clean.bash

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

13 years agofix build
Russ Cox [Wed, 2 Mar 2011 19:52:35 +0000 (14:52 -0500)]
fix build

TBR=rog
CC=golang-dev
https://golang.org/cl/4259046

13 years agobuild: fix race condition building enam.o
Dave Cheney [Wed, 2 Mar 2011 19:22:39 +0000 (14:22 -0500)]
build: fix race condition building enam.o

R=golang-dev, rsc
CC=albert.strasheim, golang-dev
https://golang.org/cl/4240055

13 years agocgo: put temporary source files in _obj.
Roger Peppe [Wed, 2 Mar 2011 19:22:33 +0000 (14:22 -0500)]
cgo: put temporary source files in _obj.
Fixes #1572.
Initially I tried changing things so all object
files get put in _obj, but it's too much - everything
needs changing. Perhaps some other time.

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

13 years agofmt: allow recursive calls to Fscan etc.
Roger Peppe [Wed, 2 Mar 2011 18:54:23 +0000 (10:54 -0800)]
fmt: allow recursive calls to Fscan etc.
Add a new Read method to ScanState so that it
satisfies the io.Reader interface; rename
Getrune and Ungetrune to ReadRune and UnreadRune.
Make sure ReadRune does not read past width restrictions;
remove now-unnecessary Width method from ScanState.
Also make the documentation a little clearer as to
how ReadRune and UnreadRune are used.

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

13 years agoruntime: record goroutine creation pc and display in traceback
Russ Cox [Wed, 2 Mar 2011 18:42:02 +0000 (13:42 -0500)]
runtime: record goroutine creation pc and display in traceback

package main

func main() {
        go func() { *(*int)(nil) = 0 }()
        select{}
}

panic: runtime error: invalid memory address or nil pointer dereference

[signal 0xb code=0x1 addr=0x0 pc=0x1c96]

runtime.panic+0xac /Users/rsc/g/go/src/pkg/runtime/proc.c:1083
        runtime.panic(0x11bf0, 0xf8400011f0)
runtime.panicstring+0xa3 /Users/rsc/g/go/src/pkg/runtime/runtime.c:116
        runtime.panicstring(0x29a57, 0x0)
runtime.sigpanic+0x144 /Users/rsc/g/go/src/pkg/runtime/darwin/thread.c:470
        runtime.sigpanic()
main._func_001+0x16 /Users/rsc/g/go/src/pkg/runtime/x.go:188
        main._func_001()
runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
        runtime.goexit()
----- goroutine created by -----
main.main+0x3d /Users/rsc/g/go/src/pkg/runtime/x.go:4

goroutine 1 [4]:
runtime.gosched+0x77 /Users/rsc/g/go/src/pkg/runtime/proc.c:598
        runtime.gosched()
runtime.block+0x27 /Users/rsc/g/go/src/pkg/runtime/chan.c:680
        runtime.block()
main.main+0x44 /Users/rsc/g/go/src/pkg/runtime/x.go:5
        main.main()
runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:77
        runtime.mainstart()
runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
        runtime.goexit()
----- goroutine created by -----
_rt0_amd64+0x8e /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:64

Fixes #1563.

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

13 years agohttp: initialize request Header for the transport
Brad Fitzpatrick [Wed, 2 Mar 2011 18:21:56 +0000 (10:21 -0800)]
http: initialize request Header for the transport

Fixes #1558

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

13 years agohttp: give ParseHTTPVersion a real example.
David Symonds [Tue, 1 Mar 2011 23:10:12 +0000 (10:10 +1100)]
http: give ParseHTTPVersion a real example.

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

13 years agohttp: expose Client's Transport
Brad Fitzpatrick [Tue, 1 Mar 2011 22:07:28 +0000 (14:07 -0800)]
http: expose Client's Transport

This is again an intentionally minimal change.

The plan is to keep Client's zero value be a usable
client, with optional fields being added over time
(e.g. cookie manager, redirect policy, auth)

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

13 years agodocs: make "runtime" a word only as a name for the package.
Rob Pike [Tue, 1 Mar 2011 21:54:22 +0000 (13:54 -0800)]
docs: make "runtime" a word only as a name for the package.

Computer people have an agglutinating streak that I like to resist.
As a time of execution: run time.
As an adjective: run-time.
As a noun: run-time support/code/library.

Signed,
Mr. Pedant.

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

13 years agofmt: delete debugging print that crept in to test.
Rob Pike [Tue, 1 Mar 2011 21:39:44 +0000 (13:39 -0800)]
fmt: delete debugging print that crept in to test.
(you'd never see it, but ouch.)
Spotted by Florian Weimer.

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

13 years agofmt: make %#p suppress leading 0x
Rob Pike [Tue, 1 Mar 2011 21:25:52 +0000 (13:25 -0800)]
fmt: make %#p suppress leading 0x

Fixes bug 1567.

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

13 years agohttp: export parseHTTPVersion.
David Symonds [Tue, 1 Mar 2011 11:38:18 +0000 (22:38 +1100)]
http: export parseHTTPVersion.

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

13 years agodoc: add FAQ about large binaries and stack vs heap allocation
Andrew Gerrand [Tue, 1 Mar 2011 10:35:46 +0000 (21:35 +1100)]
doc: add FAQ about large binaries and stack vs heap allocation
doc: add internationalization to roadmap

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

13 years agogoyacc: clarify it's package, not binary, that has
Rob Pike [Tue, 1 Mar 2011 04:47:52 +0000 (20:47 -0800)]
goyacc: clarify it's package, not binary, that has
conflict and explain that you could put the grammars
in separate packages instead.

I could be talked into rolling back the previous change
and just making a doc change instead, but I'm content
to let it stand.

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

13 years agogoyacc: provide -p flag to set prefix for names.
Rob Pike [Tue, 1 Mar 2011 01:43:16 +0000 (17:43 -0800)]
goyacc: provide -p flag to set prefix for names.

This should allow multiple goyacc grammars to be
compiled into the same binary. There's a chance it
Fixes #1562.

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

13 years agobuild: convert src/cmd to use make directly and simplify src/make.bash
Dave Cheney [Mon, 28 Feb 2011 22:20:32 +0000 (09:20 +1100)]
build: convert src/cmd to use make directly and simplify src/make.bash

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

13 years agogc: bug325 / issue 1566
Russ Cox [Mon, 28 Feb 2011 22:16:44 +0000 (17:16 -0500)]
gc: bug325 / issue 1566

Fixes #1566.

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

13 years agobuild: move $GOBIN ahead of /bin, /usr/bin in build $PATH
Russ Cox [Mon, 28 Feb 2011 19:55:27 +0000 (14:55 -0500)]
build: move $GOBIN ahead of /bin, /usr/bin in build $PATH

Otherwise if there is an installed /usr/bin/6g the build
will use that one instead of the one it builds.

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

13 years agoxml: permit nested directives
Chris Dollin [Mon, 28 Feb 2011 19:09:04 +0000 (14:09 -0500)]
xml: permit nested directives

Return <!DOCTYPE ...> with nested directives as one big token.

Fixes #1549.

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

13 years agotemplate: document the delimiters better
Rob Pike [Mon, 28 Feb 2011 18:27:33 +0000 (10:27 -0800)]
template: document the delimiters better

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

13 years agosyscall: regenerate zerrors_freebsd_amd64.go
Mikio Hara [Mon, 28 Feb 2011 15:21:19 +0000 (10:21 -0500)]
syscall: regenerate zerrors_freebsd_amd64.go

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

13 years agoruntime: idle goroutine
Russ Cox [Mon, 28 Feb 2011 04:32:42 +0000 (23:32 -0500)]
runtime: idle goroutine

This functionality might be used in environments
where programs are limited to a single thread,
to simulate a select-driven network server.  It is
not exposed via the standard runtime API.

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

13 years agocompress/lzw: don't use a closure in NewReader, which avoids having
Nigel Tao [Sat, 26 Feb 2011 05:42:49 +0000 (16:42 +1100)]
compress/lzw: don't use a closure in NewReader, which avoids having
to move some variables from the stack to the heap.

Sorted benchmark runs on my 2007-era Mac Mini (GOARCH=amd64, GOOS=linux):

Before:
lzw.BenchmarkDecoder        2000        878176 ns/op
lzw.BenchmarkDecoder        2000        878415 ns/op
lzw.BenchmarkDecoder        2000        880352 ns/op
lzw.BenchmarkDecoder        2000        898445 ns/op
lzw.BenchmarkDecoder        2000        901728 ns/op

After:
lzw.BenchmarkDecoder        2000        859065 ns/op
lzw.BenchmarkDecoder        2000        859402 ns/op
lzw.BenchmarkDecoder        2000        860035 ns/op
lzw.BenchmarkDecoder        2000        860555 ns/op
lzw.BenchmarkDecoder        2000        861109 ns/op

The ratio of before/after median times is 1.024.

The runtime.MemStats.Mallocs delta per loop drops from 109 to 104.

R=r, r2, dfc
CC=golang-dev
https://golang.org/cl/4253043

13 years agocompress/lzw: fix the stupidity of allocating and zeroing a new buffer
Nigel Tao [Fri, 25 Feb 2011 22:25:29 +0000 (09:25 +1100)]
compress/lzw: fix the stupidity of allocating and zeroing a new buffer
on each loop iteration, yielding a 20x performance improvement.

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

13 years agocrypto/openpgp: fix test prints
Rob Pike [Fri, 25 Feb 2011 21:44:37 +0000 (13:44 -0800)]
crypto/openpgp: fix test prints

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

13 years agoruntime: omit breakpoint during terminal panic
Russ Cox [Fri, 25 Feb 2011 20:17:34 +0000 (15:17 -0500)]
runtime: omit breakpoint during terminal panic

again.
CL 4222043 missed this case.

R=brainman, r, r2
CC=golang-dev
https://golang.org/cl/4235043

13 years agosync/atomic: make BUG comment godoc-compatible
Russ Cox [Fri, 25 Feb 2011 19:40:36 +0000 (14:40 -0500)]
sync/atomic: make BUG comment godoc-compatible

go/doc wants to see text after BUG(uid): on the same line
in order to treat it as an official bug comment.

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

13 years agoruntime: use kernel-supplied cas on linux/arm
Russ Cox [Fri, 25 Feb 2011 19:29:55 +0000 (14:29 -0500)]
runtime: use kernel-supplied cas on linux/arm

Using the kernel-supplied compare-and-swap code
on linux/arm means that runtime doesn't have to care
whether this is GOARM=5 or GOARM=6 anymore.

Fixes #1494.

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

13 years agosync: use sync/atomic
Russ Cox [Fri, 25 Feb 2011 19:29:47 +0000 (14:29 -0500)]
sync: use sync/atomic

Remove references to custom assembly routines.

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

13 years agosync/atomic: new package
Russ Cox [Fri, 25 Feb 2011 19:29:36 +0000 (14:29 -0500)]
sync/atomic: new package

Fixes #170.

R=gri, iant, r, r2
CC=golang-dev
https://golang.org/cl/4241041

13 years agoA+C: Chris Dollin (individual CLA)
Russ Cox [Fri, 25 Feb 2011 19:05:44 +0000 (14:05 -0500)]
A+C: Chris Dollin (individual CLA)

R=r, r2, gri
CC=ehog.hedge, golang-dev
https://golang.org/cl/4240043

13 years agogob: make recursive map and slice types work.
Rob Pike [Fri, 25 Feb 2011 17:45:06 +0000 (09:45 -0800)]
gob: make recursive map and slice types work.

Before this fix, types such as
        type T map[string]T
caused infinite recursion in the gob implementation.
Now they just work.

Fixes #1518.

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

13 years ago8a, 8l: add CMPXCHG8B, XADDB, XADDL, XADDW
Russ Cox [Fri, 25 Feb 2011 06:04:29 +0000 (01:04 -0500)]
8a, 8l: add CMPXCHG8B, XADDB, XADDL, XADDW

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

13 years ago5a, 5l: add LDREXD, STREXD
Russ Cox [Fri, 25 Feb 2011 06:03:54 +0000 (01:03 -0500)]
5a, 5l: add LDREXD, STREXD

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

13 years agobug324.go: test case for issue 1550
Robert Griesemer [Fri, 25 Feb 2011 03:29:25 +0000 (19:29 -0800)]
bug324.go: test case for issue 1550

Also: renamed fixedbugs/bug322.go to fixedbugs/bug323.go
because we already have a bugs/bug322.go and bug322.dir.

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

13 years agotag release.2011-02-24
Andrew Gerrand [Fri, 25 Feb 2011 03:24:08 +0000 (14:24 +1100)]
tag release.2011-02-24

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

13 years agorelease.2011-02-24 weekly.2011-02-24
Andrew Gerrand [Fri, 25 Feb 2011 03:13:14 +0000 (14:13 +1100)]
release.2011-02-24

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

13 years agocrypto/openpgp: add package
Adam Langley [Fri, 25 Feb 2011 01:19:53 +0000 (20:19 -0500)]
crypto/openpgp: add package

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

13 years agogodoc: accept symbolic links as path names provided to -path
Robert Griesemer [Fri, 25 Feb 2011 00:24:51 +0000 (16:24 -0800)]
godoc: accept symbolic links as path names provided to -path

When providing addition file systems to godoc via -path, the
path names may be symbolic links. Follow them.

Also: better logging of error and special conditions.

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

13 years agoruntime: add empty windows/signals.h file to fix build
Alex Brainman [Fri, 25 Feb 2011 00:16:39 +0000 (11:16 +1100)]
runtime: add empty windows/signals.h file to fix build

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

13 years agocompress/lzw: implement an encoder.
Nigel Tao [Thu, 24 Feb 2011 22:20:04 +0000 (09:20 +1100)]
compress/lzw: implement an encoder.

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

13 years agoreflect: add pointer word to CommonType
Russ Cox [Thu, 24 Feb 2011 22:11:20 +0000 (17:11 -0500)]
reflect: add pointer word to CommonType

The pointer will eventually let us find *T given T.
This CL just makes room for it, always storing a zero.

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

13 years agoruntime: fix signal stack bug
Russ Cox [Thu, 24 Feb 2011 21:46:44 +0000 (13:46 -0800)]
runtime: fix signal stack bug

In CL 4188061 I changed malg to allocate the requested
number of bytes n, not n+StackGuard, so that the
allocations would use rounder numbers.

The allocation of the signal stack asks for 32k and
then used g->stackguard as the base, but g->stackguard
is StackGuard bytes above the base.  Previously, asking
for 32k meant getting 32k+StackGuard bytes, so using
g->stackguard as the base was safe.  Now, the actual base
must be computed, so that the signal handler does not
run StackGuard bytes past the top of the stack.

Was causing flakiness mainly in programs that use the
network, because they sometimes write to closed network
connections, causing SIGPIPEs.  Was also causing problems
in the doc/progs test.

Also fix Makefile so that changes to stack.h trigger rebuild.

R=bradfitzgo, r, r2
CC=golang-dev
https://golang.org/cl/4230044

13 years agold: weak symbols
Russ Cox [Thu, 24 Feb 2011 21:45:45 +0000 (16:45 -0500)]
ld: weak symbols

A reference to the address of weak.foo resolves at link time
to the address of the symbol foo if foo would end up in the
binary anyway, or to zero if foo would not be in the binary.

For example:

        int xxx = 1;
        int yyy = 2;
        int weak·xxx;
        int weak·yyy;

        void main·main(void) {
                runtime·printf("%p %p %p\n", &xxx, &weak·xxx, &weak·yyy);
        }

prints the same non-nil address twice, then 0 (because yyy is not
referenced so it was dropped from the binary).

This will be used by the reflection tables.

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

13 years agohttp: remove debugging log statement
Russ Cox [Thu, 24 Feb 2011 19:36:18 +0000 (14:36 -0500)]
http: remove debugging log statement

Issue 1547 is fixed.

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

13 years agogodoc: fix writeFileAtomically utility function
Robert Griesemer [Thu, 24 Feb 2011 19:13:20 +0000 (11:13 -0800)]
godoc: fix writeFileAtomically utility function

If the filename was absolute, writeFileAtomically
used the wrong filename for ioutil.TempFile leading
to non-existent directories and the TempFile would
fail.

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