1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:31:21 -06:00
Commit Graph

16425 Commits

Author SHA1 Message Date
Adam Langley
21cf646bfc crypto/tls: fix flakey test.
A test added in b37d2fdcc4d9 didn't work with some values of GOMAXPROCS
because the defer statements were in the wrong order: the Pipe could be
closed before the TLS Client was.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9187047
2013-05-16 12:29:23 -04:00
Alex Brainman
a65f861bfa os: use small buffer when reading from windows console
Fixes #5481.

R=golang-dev, dominik.honnef, bradfitz
CC=golang-dev
https://golang.org/cl/9437044
2013-05-16 17:20:13 +10:00
Rémy Oudompheng
78f5b616fc cmd/gc: repair make(T) in export data for inlining.
When T was an unexported type it could be forgotten.

Fixes #5470.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9303050
2013-05-16 09:01:43 +02:00
Brad Fitzpatrick
0af302f507 time: add Time.FormatAppend
This is a version of Time.Format that doesn't require allocation.

Fixes #5192
Update #5195

R=r
CC=gobot, golang-dev
https://golang.org/cl/8478044
2013-05-15 17:23:40 -07:00
Robert Hencke
f7b5a01999 reflect: use visit structure for map key in DeepEqual
R=golang-dev, bradfitz, jonathan, r
CC=golang-dev
https://golang.org/cl/8730044
2013-05-15 14:50:57 -07:00
Dmitriy Vyukov
c6293d2106 runtime: fix GC scanning of slices
If a slice points to an array embedded in a struct,
the whole struct can be incorrectly scanned as the slice buffer.
Fixes #5443.

R=cshapiro, iant, r, cshapiro, minux.ma
CC=bradfitz, gobot, golang-dev
https://golang.org/cl/9372044
2013-05-15 23:50:32 +04:00
Rob Pike
9e643ac20e misc/dashboard/codereview: add cshapiro and mpvl to reviewers list.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9104052
2013-05-15 10:25:02 -07:00
Dmitriy Vyukov
915784e11a runtime: add simple malloc benchmarks
Allocs of size 16 can bypass atomic set of the allocated bit, while allocs of size 8 can not.
Allocs with and w/o type info hit different paths inside of malloc.
Current results on linux/amd64:
BenchmarkMalloc8	50000000	        43.6 ns/op
BenchmarkMalloc16	50000000	        46.7 ns/op
BenchmarkMallocTypeInfo8	50000000	        61.3 ns/op
BenchmarkMallocTypeInfo16	50000000	        63.5 ns/op

R=golang-dev, remyoudompheng, minux.ma, bradfitz, iant
CC=golang-dev
https://golang.org/cl/9090045
2013-05-15 21:22:32 +04:00
Keith Randall
ee66972dce runtime: Optimize aeshash a bit. Use a better predicted branch
for checking for page boundary.  Also avoid boundary check
when >=16 bytes are hashed.

benchmark                        old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                23           22   -0.43%
BenchmarkHashBytesSpeed                 44           42   -3.61%
BenchmarkHashStringArraySpeed           71           68   -4.05%

R=iant, khr
CC=gobot, golang-dev, google
https://golang.org/cl/9123046
2013-05-15 09:40:14 -07:00
Dmitriy Vyukov
23ad563119 runtime: transfer whole span from MCentral to MCache
Finer-grained transfers were relevant with per-M caches,
with per-P caches they are not relevant and harmful for performance.
For few small size classes where it makes difference,
it's fine to grab the whole span (4K).

benchmark          old ns/op    new ns/op    delta
BenchmarkMalloc           42           40   -4.45%

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9374043
2013-05-15 18:35:05 +04:00
Adam Langley
e85e678899 crypto/rsa: check for minimal PKCS#1 v1.5 padding.
The PKCS#1 spec requires that the PS padding in an RSA message be at
least 8 bytes long. We were not previously checking this. This isn't
important in the most common situation (session key encryption), but
the impact is unclear in other cases.

This change enforces the specified minimum size.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9222045
2013-05-15 10:27:34 -04:00
Adam Langley
a1dbfee15b crypto/tls: ignore empty TLS records.
OpenSSL can be configured to send empty records in order to randomise
the CBC IV. This is an early version of 1/n-1 record splitting (that Go
does) and is quite reasonable, but it results in tls.Conn.Read
returning (0, nil).

This change ignores up to 100 consecutive, empty records to avoid
returning (0, nil) to callers.

Fixes 5309.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/8852044
2013-05-15 10:25:54 -04:00
Adam Langley
133cdb6707 math/big: save some copies in binaryGCD.
This patch resulted from a bit of quick optimisation in response to a
golang-nuts post. It looks like one could save a couple other copies in
this function, but this addresses the inner loop and is fairly simple.

benchmark                    old ns/op    new ns/op    delta
BenchmarkGCD10x10                 1964         1711  -12.88%
BenchmarkGCD10x100                2019         1736  -14.02%
BenchmarkGCD10x1000               2471         2171  -12.14%
BenchmarkGCD10x10000              6040         5778   -4.34%
BenchmarkGCD10x100000            43204        43025   -0.41%
BenchmarkGCD100x100              11004         8520  -22.57%
BenchmarkGCD100x1000             11820         9446  -20.08%
BenchmarkGCD100x10000            23846        21382  -10.33%
BenchmarkGCD100x100000          133691       131505   -1.64%
BenchmarkGCD1000x1000           120041        95591  -20.37%
BenchmarkGCD1000x10000          136887       113600  -17.01%
BenchmarkGCD1000x100000         295370       273912   -7.26%
BenchmarkGCD10000x10000        2556126      2205198  -13.73%
BenchmarkGCD10000x100000       3159512      2808038  -11.12%
BenchmarkGCD100000x100000    150543094    139986045   -7.01%

R=gri, remyoudompheng
CC=bradfitz, gobot, golang-dev, gri
https://golang.org/cl/9424043
2013-05-15 10:03:22 -04:00
Dmitriy Vyukov
764bb36ea2 runtime: unset m->locks after actual lock unlock
This is needed for preemptive scheduler,
it will preempt only when m->locks==0,
and we do not want to be preempted while
we have not completely unlocked the lock.

R=golang-dev, khr, iant
CC=golang-dev
https://golang.org/cl/9196047
2013-05-15 16:48:41 +04:00
Dmitriy Vyukov
e69012ce2a runtime: use enums instead static vars for debugging
Compiler can detect and delete dead code with enums,
but can not with static vars.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/9377043
2013-05-15 11:10:26 +04:00
Dmitriy Vyukov
5a89b35bca runtime: inline size to class conversion in malloc()
Also change table type from int32[] to int8[] to save space in L1$.

benchmark          old ns/op    new ns/op    delta
BenchmarkMalloc           42           40   -4.68%

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/9199044
2013-05-15 11:02:33 +04:00
Alex Brainman
3de593d94b misc/cgo/test: add missing import
Fixes windows build.

R=golang-dev
CC=golang-dev
https://golang.org/cl/9429043
2013-05-15 15:34:47 +10:00
Shenghou Ma
512ec7036e misc/cgo/test: test for issue 5337.
Test for CL 9226043.

R=golang-dev, dave, iant, bradfitz
CC=golang-dev
https://golang.org/cl/9249043
2013-05-15 12:33:29 +08:00
Brad Fitzpatrick
d9d8d4c62c cmd/godoc: don't warn about HEAD requests
Fixes #5451

R=gri
CC=dsymonds, gobot, golang-dev
https://golang.org/cl/9388043
2013-05-14 21:21:11 -07:00
Shenghou Ma
2eeab323ad cmd/yacc: don't emit line comment when -l is given
Fixes #5447.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9343045
2013-05-15 12:08:51 +08:00
Alexey Borzenkov
fae362e97e os/user: faster user lookup on Windows
Trying to lookup user's display name with directory services can
take several seconds when user's computer is not in a domain.
As a workaround, check if computer is joined in a domain first,
and don't use directory services if it is not.
Additionally, don't leak tokens in user.Current().
Fixes #5298.

R=golang-dev, bradfitz, alex.brainman, lucio.dere
CC=golang-dev
https://golang.org/cl/8541047
2013-05-15 13:24:54 +10:00
Dominik Honnef
72b14cbb75 misc/emacs: Add support for methods with unnamed receiver
This fixes fontification, navigation and indentation for methods
of the form `func (Foo) Bar...`

R=adonovan
CC=gobot, golang-dev
https://golang.org/cl/8951043
2013-05-14 20:23:35 -07:00
Jonathan Hseu
c691ae6764 testing/quick: fix for aliased types, delete duplicate uint8 test, and fix randFloat64() to give random numbers from (-math.MaxFloat64, math.MaxFloat64).
R=r, agl
CC=agl, bradfitz, golang-dev
https://golang.org/cl/9296046
2013-05-14 17:14:59 -07:00
Carl Shapiro
0e6007e4f9 runtime: enable stack scanning by frames
Update #5134

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9406046
2013-05-14 16:38:12 -07:00
Brad Fitzpatrick
0bbf0ec0ed database/sql: use method values instead of generating closures
Reduces garbage.

R=adg, r
CC=dsymonds, gobot, golang-dev
https://golang.org/cl/9088045
2013-05-14 16:35:31 -07:00
Rémy Oudompheng
6c4943cb51 cmd/gc: fix race instrumentation of selectors T(v).Field
Fixes #5424.

R=golang-dev, daniel.morsing, dvyukov, r
CC=golang-dev
https://golang.org/cl/9033048
2013-05-15 01:25:20 +02:00
Keith Randall
b3946dc119 runtime/bytes: fast Compare for byte arrays and strings.
Uses SSE instructions to process 16 bytes at a time.

fixes #5354

R=bradfitz, google
CC=golang-dev
https://golang.org/cl/8853048
2013-05-14 16:05:51 -07:00
Brad Fitzpatrick
f1583bb956 encoding/json: allocate less in NewEncoder
The *Encoder is almost always garbage. It doesn't need an
encodeState inside of it (and its bytes.Buffer), since it's
only needed locally inside of Encode.

benchmark                 old ns/op    new ns/op    delta
BenchmarkEncoderEncode         2562         2553   -0.35%

benchmark                 old bytes    new bytes    delta
BenchmarkEncoderEncode          283          102  -63.96%

R=r
CC=gobot, golang-dev
https://golang.org/cl/9365044
2013-05-14 15:50:46 -07:00
Rob Pike
d73452b30f cmd/vet: fix for changes to go/types package
Need to use (or stub) exact.Value.

R=gri
CC=golang-dev
https://golang.org/cl/9126043
2013-05-14 15:49:58 -07:00
Alberto García Hierro
d535bc7af3 net/http: Fix basic authentication with empty password
The encoded string must include the : separating the username
        and the password, even when the latter is empty. See
        http://www.ietf.org/rfc/rfc2617.txt for more information.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8475043
2013-05-14 15:33:46 -07:00
Brad Fitzpatrick
55c14fde8a A+C: Alberto García Hierro (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/9419045
2013-05-14 15:31:46 -07:00
Shenghou Ma
9c94580921 archive/tar: skip NUL-filled unused octal fields
Fixes #5290.

R=golang-dev, dave, bradfitz, r
CC=golang-dev
https://golang.org/cl/8763044
2013-05-15 04:40:42 +08:00
Robin Eklind
392cebea5d image: minor update of comments.
R=golang-dev, iant, bradfitz, nigeltao
CC=golang-dev
https://golang.org/cl/9408044
2013-05-14 13:28:16 -07:00
Shenghou Ma
3ac5d54cf9 cmd/gc: improve syntax error for "import testing"
for this program:
package A
import testing

old diagnostics:
pkg.go:2: syntax error: unexpected semicolon or newline, expecting string literal

now:
pkg.go:2: syntax error: missing import path; require quoted string

Fixes #5332.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9393043
2013-05-15 04:19:19 +08:00
Shenghou Ma
df29cdd33d doc/go_spec: fix typos
Fixes #5456.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9400044
2013-05-15 03:50:27 +08:00
Bill Thiede
27f7e3b217 misc/vim: test.sh seems to only work on Mac OS X.
cmp(1) on FreeBSD requires two file arguments.  grep -P on Linux (at least
Ubuntu 12.04) is described in the man page as "This is highly
experimental" and doesn't seem to work. On FreeBSD the man page states
"This option  is not supported in FreeBSD."  Needed this to work while
debugging some funky behavior of 'Import' in my local vim setup.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7675043
2013-05-14 09:54:16 -07:00
Brad Fitzpatrick
2184282308 cmd/api: don't print out except.txt removed features to stdout
It's just noise. They've already been acknowledged in except.txt.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9392047
2013-05-14 09:43:56 -07:00
Brad Fitzpatrick
67acff0b09 go/token: let FileSet.AddFile take a negative base
Negative base now means "automatic". Fixes a higher
level race.

Fixes #5418

R=gri
CC=golang-dev
https://golang.org/cl/9269043
2013-05-14 09:30:13 -07:00
Andrew Gerrand
0bfee01523 tag go1.1 2013-05-13 13:04:08 -07:00
Dmitriy Vyukov
5a7e14c143 runtime/race: improve public documentation
Move the documentation from race.go to doc.go, because
race.go uses +build race, so it's not normally parsed by go doc.
Rephrase the documentation for end users, provide link to race
detector manual.
Fixes #5444.

R=golang-dev, minux.ma, adg, r
CC=golang-dev
https://golang.org/cl/9144050
2013-05-13 10:28:12 +04:00
Nigel Tao
0ae5036b26 doc: add a "New packages" section to the 1.1 release notes.
R=adg, r
CC=golang-dev
https://golang.org/cl/9344044
2013-05-12 21:58:27 -07:00
Andrew Gerrand
12ab08a87b tag go1.1rc3
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9124045
2013-05-08 16:06:25 -07:00
Ian Lance Taylor
26d95d8027 runtime: fix crash in select
runtime.park() can access freed select descriptor
due to a racing free in another thread.
See the comment for details.

Slightly modified version of dvyukov's CL 9259045.

No test yet.  Before this CL, the test described in issue 5422
would fail about every 40 times for me.  With this CL, I ran
the test 5900 times with no failures.

Fixes #5422.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9311043
2013-05-08 14:58:34 -07:00
Robert Griesemer
2d846f6521 spec: fix incorrect example
Fixes #5430.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9305043
2013-05-08 10:42:08 -07:00
Andrew Gerrand
f0c3d26473 doc: pull front page featured articles using new blog JSON feed
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9288045
2013-05-08 09:23:50 -07:00
Ian Lance Taylor
8a28085a0f cmd/cgo: pass -Wsystem-headers when looking for errors
This works around a bug in GCC 4.8.0.

Fixes #5118.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/9120045
2013-05-08 06:28:33 -07:00
Alex Brainman
e1922febbe net: fix dial race on plan9 and windows
Fixes #5349.

R=golang-dev, lucio.dere, dsymonds, bradfitz, iant, adg, dave, r
CC=golang-dev
https://golang.org/cl/9159043
2013-05-08 16:19:02 +10:00
Rob Pike
2f326da27e effective_go.html: be more accepting in the guidelines for interface names
Fixes #5421.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/9274043
2013-05-07 11:41:36 -07:00
Andrew Gerrand
a155a5a68f tag go1.1rc2 2013-05-06 17:34:17 -07:00
Brad Fitzpatrick
9e93d5014e api: add go1.1.txt; update cmd/api to use it
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/9250043
2013-05-06 17:25:09 -07:00