Commit graph

16466 commits

Author SHA1 Message Date
Bill Neubauer 82ef961af5 runtime: fix runtime·netpoll() to call runtime·netpollready() only once per event.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9808043
2013-05-28 05:03:10 +08:00
Shenghou Ma ae73b90369 runtime: make arm signal handler call runtime.badsignal
In preparation for CL 9249043 (already submitted).

Fixes #5553.

R=golang-dev, iant, capnm9, dave
CC=golang-dev
https://golang.org/cl/9251043
2013-05-27 20:46:53 +08:00
Dmitriy Vyukov 5782f4117d runtime: introduce cnewarray() to simplify allocation of typed arrays
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9648044
2013-05-27 11:29:11 +04:00
Jan Ziak e017e0cb24 runtime: flag static variables as no-pointers
Variables in data sections of 32-bit executables interfere with
garbage collector's ability to free objects and/or unnecessarily
slow down the garbage collector.

This changeset moves some static variables to .noptr sections.
'files' in symtab.c is now allocated dynamically.

R=golang-dev, dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/9786044
2013-05-27 08:11:59 +02:00
Brian G. Merrell 20c524c5e2 effective_go.html: Fix two links
This fixes two intra-page "type assertion" links that were broken in
different ways.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9797043
2013-05-27 11:00:12 +10:00
David Symonds 1276e507bb A+C: Brian G. Merrell (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/9797044
2013-05-27 10:59:34 +10:00
Dmitriy Vyukov 46137f227b runtime: update comment on stack allocator
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9665046
2013-05-25 22:47:36 +04:00
Alex Brainman a2ec8abd2d cmd/cgo: do not output empty struct for -cdefs
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9574043
2013-05-25 20:53:55 +10:00
Rob Pike 7472ce0e58 fmt.Printf: introduce notation for random access to arguments.
This text is added to doc.go:

        Explicit argument indexes:

        In Printf, Sprintf, and Fprintf, the default behavior is for each
        formatting verb to format successive arguments passed in the call.
        However, the notation [n] immediately before the verb indicates that the
        nth one-indexed argument is to be formatted instead. The same notation
        before a '*' for a width or precision selects the argument index holding
        the value. After processing a bracketed expression [n], arguments n+1,
        n+2, etc. will be processed unless otherwise directed.

        For example,
                fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
        will yield "22, 11", while
                fmt.Sprintf("%[3]*[2].*[1]f", 12.0, 2, 6),
        equivalent to
                fmt.Sprintf("%6.2f", 12.0),
        will yield " 12.00". Because an explicit index affects subsequent verbs,
        this notation can be used to print the same values multiple times
        by resetting the index for the first argument to be repeated:
                fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
        will yield "16 17 0x10 0x11".

The notation chosen differs from that in C, but I believe it's easier to read
and to remember (we're indexing the arguments), and compatibility with
C's printf was never a strong goal anyway.

While we're here, change the word "field" to "arg" or "argument" in the
code; it was being misused and was confusing.

R=rsc, bradfitz, rogpeppe, minux.ma, peter.armitage
CC=golang-dev
https://golang.org/cl/9680043
2013-05-24 15:49:26 -07:00
David du Colombier ffe8a3c5e2 build: fix make.rc on Plan 9
Set $status as null to prevent rc from exiting
on the last --no-banner argument checking when
used with rc -e. It allows all.rc to not exit
before executing run.rc

R=golang-dev, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/9611045
2013-05-24 13:55:19 -07:00
Russ Cox 30fde1b279 doc: start go 1.2 notes
This is a file of hints, not a file of polished text.
Let's not try to do polished text until we start the
release process.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9750043
2013-05-24 16:34:50 -04:00
Adam Langley ddc8679128 crypto/x509: harmonise error prefixes.
crypto/x509 has ended up with a variety of error formats. This change makes them all start with "x509: ".

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9736043
2013-05-24 16:23:13 -04:00
Rob Pike 650a1ef66f cmd/cov: delete
It doesn't work, it's not portable, it's not part of the released
binaries, and a better tool is due.

Fixes #1319.
Fixes #4621.

R=golang-dev, bradfitz, dave, rsc
CC=golang-dev
https://golang.org/cl/9681044
2013-05-24 11:06:06 -07:00
Christopher Nielsen ee78a707c0 path/filepath: Skip TestEvalSymlinks. Plan 9 doesn't have symlinks.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9713044
2013-05-24 11:01:04 -07:00
Gerasimos Dimitriadis af48543c54 asn1: Stricter checks for DER encoded booleans
According to X.690, only 0 and 255 are allowed as values
for encoded booleans. Also added some test for parsing
booleans

R=golang-dev, agl, r
CC=golang-dev
https://golang.org/cl/9692043
2013-05-24 12:37:42 -04:00
Adam Langley 64e98171ca A+C: Gerasimos Dimitriadis (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/9734043
2013-05-24 12:36:59 -04:00
Dmitriy Vyukov 0806c97209 log/syslog: fix deadlock in test
The problem was that server handlers block on done<-,
the goroutine that reads from done blocks on count<-,
and the main goroutine that is supposed to read from count
waits for server handlers to exit.
Fixes #5547.

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/9722043
2013-05-24 18:35:48 +04:00
Dave Cheney 2ca589d494 misc/cgo/testso: use bash to run test.bash
R=golang-dev, minux.ma, capnm9
CC=golang-dev
https://golang.org/cl/9717043
2013-05-24 07:56:01 -04:00
Ian Lance Taylor 598de87b0f cmd/cgo: change GoStringN and GoBytes from intgo to int32
Fixes build.

R=golang-dev
CC=golang-dev
https://golang.org/cl/9667047
2013-05-23 23:19:47 -07:00
Ian Lance Taylor 8f7863d638 cmd/cgo: use intgo, not int, for string and slice structures
Fixes #5548.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9643044
2013-05-23 22:51:07 -07:00
Rob Pike 9bdb7e1967 test/bench/shootout/timing.log: update to Go 1.1
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9656045
2013-05-23 17:57:28 -07:00
Frederick Kelly Mayle III 7b9df09261 runtime: faster range on empty map
benchmark                old ns/op    new ns/op    delta
BenchmarkMapIter               191          190   -0.52%
BenchmarkMapIterEmpty           22            4  -78.96%

R=golang-dev, minux.ma, dvyukov, iant, khr
CC=golang-dev
https://golang.org/cl/9637043
2013-05-23 14:17:52 -07:00
Brad Fitzpatrick c6b6c4ac39 A+C: Frederick Kelly Mayle III (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/9669044
2013-05-23 14:17:32 -07:00
Brad Fitzpatrick 3b7dcf074f codereview: close the head tag
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9695045
2013-05-23 14:13:39 -07:00
Dominik Honnef 4e15dbe082 misc/emacs: Do not modify kill ring when programmatically deleting text
Operations like gofmt and go-remove-unused-imports delete entire
lines of text. Previously this put them on the kill-ring,
negatively affecting user experience.

R=adonovan
CC=gobot, golang-dev
https://golang.org/cl/9605043
2013-05-23 10:19:03 -07:00
Daniel Morsing fdc4ce6ec7 io: Prioritize WriterTos over ReaderFroms in Copy.
This only affects calls where both ReaderFrom and WriterTo are implemented. WriterTo can issue one large write, while ReaderFrom must Read until EOF, potentially reallocating when out of memory. With one large Write, the Writer only needs to allocate once.

This also helps in ioutil.Discard since we can avoid copying memory when the Reader implements WriterTo.

R=golang-dev, dsymonds, remyoudompheng, bradfitz
CC=golang-dev, minux.ma
https://golang.org/cl/9462044
2013-05-23 18:29:19 +02:00
Nan Deng 876455f3ba crypto/rsa: implement PSS signatures.
This change contains an implementation of the RSASSA-PSS signature
algorithm described in RFC 3447.

R=agl, agl
CC=gobot, golang-dev, r
https://golang.org/cl/9438043
2013-05-23 11:10:41 -04:00
Mikio Hara adbe59e332 syscall: add IPv6 socket options for Unix variants
This CL adds missing IPv6 socket options which are required
to control IPv6 as described in RFC 3493, RFC 3542.

Update #5538

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/9373046
2013-05-23 16:22:05 +09:00
Alex Brainman d67e300f28 cmd/go: check GOROOT directory is present before acting
Fixes #5042.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/7786047
2013-05-23 14:13:02 +10:00
Francesc Campoy 4b2eb3f9f8 codereview.py: improve error message when user is not a committer
R=adg, bradfitz, r
CC=golang-dev
https://golang.org/cl/9626045
2013-05-22 16:27:39 -07:00
Robert Griesemer e3a72b05f8 go/doc: fix build
1) go/doc:
   - create correct ast.FuncType
   - use more commonly used variable names in a test case

2) make ast.FuncType.Pos robust in case of incorrect ASTs

R=golang-dev
CC=golang-dev
https://golang.org/cl/9651044
2013-05-22 14:22:50 -07:00
Adam Langley 8f37e41963 A+C: Nan Deng (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/9678043
2013-05-22 17:08:59 -04:00
Rémy Oudompheng 3577398f82 test: add test for issue 3888.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9676043
2013-05-22 22:45:38 +02:00
Shenghou Ma 1beb791934 test/errchk: use "#!/usr/bin/env perl" shebang line
fix test failure of go.tools sub-repo on NetBSD.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9662044
2013-05-23 04:41:22 +08:00
Shenghou Ma cb8782e8b3 bufio: fix SplitFunc docs
Fixes #5532.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9672044
2013-05-23 04:38:32 +08:00
Robert Griesemer 75b62e367b go/ast: fix FuncType.Pos() impl. and FuncType.Params documentation
As pointed out by adonovan.

R=golang-dev, adonovan
CC=golang-dev
https://golang.org/cl/9662045
2013-05-22 13:36:43 -07:00
Ian Lance Taylor 452f3bc759 doc: GCC 4.8.1 is not updated to Go 1.1
I will try again for 4.8.2.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9663045
2013-05-22 13:05:31 -07:00
Rob Pike e17a6d4b9d log/syslog: report errors from write
Fixes #5541.
This time for sure.

R=golang-dev, minux.ma, iant
CC=golang-dev
https://golang.org/cl/9668043
2013-05-22 12:45:52 -07:00
Daniel Morsing dbee8ad0f9 cmd/cc: reject unions containing pointers
If a union contains a pointer, it will mess up the garbage collector, causing memory corruption.

R=golang-dev, dave, nightlyone, adg, dvyukov, bradfitz, minux.ma, r, iant
CC=golang-dev
https://golang.org/cl/8469043
2013-05-22 21:13:30 +02:00
Dmitriy Vyukov 72c4ee1a9d runtime: properly synchronize GC and finalizer goroutine
This is needed for preemptive scheduler, because the goroutine
can be preempted at surprising points.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9376043
2013-05-22 23:04:46 +04:00
Dmitriy Vyukov 34c67eb24e runtime: detect deadlocks in programs using cgo
When cgo is used, runtime creates an additional M to handle callbacks on threads not created by Go.
This effectively disabled deadlock detection, which is a right thing, because Go program can be blocked
and only serve callbacks on external threads.
This also disables deadlock detection under race detector, because it happens to use cgo.
With this change the additional M is created lazily on first cgo call. So deadlock detector
works for programs that import "C", "net" or "net/http/pprof" but do not use them in fact.
Also fixes deadlock detector under race detector.
It should be fine to create the M later, because C code can not call into Go before first cgo call,
because C code does not know when Go initialization has completed. So a Go program need to call into C
first either to create an external thread, or notify a thread created in global ctor that Go
initialization has completed.
Fixes #4973.
Fixes #5475.

R=golang-dev, minux.ma, iant
CC=golang-dev
https://golang.org/cl/9303046
2013-05-22 22:57:47 +04:00
Shenghou Ma a3393e1750 cmd/go: use "go get" instead of "go install" to install vet
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9662043
2013-05-23 02:46:07 +08:00
Rob Pike f6c7b339a6 undo CL 9658043 / ac7877558dce
The original code was correct. The count returned must be the length
of the input slice, not the length of the formatted message.

««« original CL description
log/syslog: report errors from Fprintf
Thanks to chiparus for identifying this.

Fixes #5541.

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

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9644044
2013-05-22 11:42:04 -07:00
Dmitriy Vyukov c075d82cca runtime: fix and speedup malloc stats
Currently per-sizeclass stats are lost for destroyed MCache's. This patch fixes this.
Also, only update mstats.heap_alloc on heap operations, because that's the only
stat that needs to be promptly updated. Everything else needs to be up-to-date only in ReadMemStats().

R=golang-dev, remyoudompheng, dave, iant
CC=golang-dev
https://golang.org/cl/9207047
2013-05-22 22:22:57 +04:00
Rob Pike 4c2df76b7d log/syslog: report errors from Fprintf
Thanks to chiparus for identifying this.

Fixes #5541.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9658043
2013-05-22 11:03:10 -07:00
Shenghou Ma 6289dccf8b include: add a README file
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9392049
2013-05-22 18:51:15 +08:00
Dmitriy Vyukov c4cfef075e runtime: simplify MCache
The nlistmin/size thresholds are copied from tcmalloc,
but are unnecesary for Go malloc. We do not do explicit
frees into MCache. For sparse cases when we do (mainly hashmap),
simpler logic will do.

R=rsc, dave, iant
CC=gobot, golang-dev, r, remyoudompheng
https://golang.org/cl/9373043
2013-05-22 13:29:17 +04:00
Rob Pike 23dec8d190 cmd/go: support new location for vet
Also delete the special case for exp, which isn't necessary any more.

Fixes #5529.

R=rsc, nightlyone
CC=golang-dev
https://golang.org/cl/9611048
2013-05-21 21:18:10 -07:00
David Symonds c912150761 doc/go_faq: fix example.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9564044
2013-05-22 12:28:58 +10:00
Brad Fitzpatrick 950fa93531 net/http: add another Hijacker test
R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/9570043
2013-05-21 18:43:28 -07:00