]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agotesting: fix memory blowup when formatting many lines.
Rémy Oudompheng [Tue, 17 Jul 2012 05:56:25 +0000 (07:56 +0200)]
testing: fix memory blowup when formatting many lines.

Fixes #3830.

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

12 years agocmd/vet: provide flags to control which tests to run
Rob Pike [Mon, 16 Jul 2012 21:03:11 +0000 (14:03 -0700)]
cmd/vet: provide flags to control which tests to run
By default, all are still run, but a particular test can be
selected with the new flags.

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

12 years agofaq: add status section
Rob Pike [Mon, 16 Jul 2012 20:31:15 +0000 (13:31 -0700)]
faq: add status section
Fixes #3822.

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

12 years agoA+C: Peter Armitage (individual CLA)
Adam Langley [Mon, 16 Jul 2012 13:35:14 +0000 (09:35 -0400)]
A+C: Peter Armitage (individual CLA)

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

12 years agocompress/flate: fix panic when nlit is out of bounds.
Nigel Tao [Mon, 16 Jul 2012 02:01:18 +0000 (12:01 +1000)]
compress/flate: fix panic when nlit is out of bounds.

Fixes #3815.

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

12 years agoos: add missing full stop in comment
Benny Siegert [Sun, 15 Jul 2012 16:48:31 +0000 (09:48 -0700)]
os: add missing full stop in comment

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

12 years agobuild: revert 61d1d72136f7 (add few tests with GOMAXPROCS=32)
Dmitriy Vyukov [Sat, 14 Jul 2012 11:59:52 +0000 (15:59 +0400)]
build: revert 61d1d72136f7 (add few tests with GOMAXPROCS=32)
Some tests currently fail with GOMAXPROCS>1

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

12 years agobuild: add few tests with GOMAXPROCS=32 to run.bash
Dmitriy Vyukov [Sat, 14 Jul 2012 11:46:53 +0000 (15:46 +0400)]
build: add few tests with GOMAXPROCS=32 to run.bash
Some class of bugs (data races, runtime bugs) can be found
only with real parallelism.
Note that GOMAXPROCS=32 is somewhat different from go test -cpu=32,
this intentionally uses GOMAXPROCS to stress program bootstrap,
testing code, garbage collections, etc.
Package selection is mostly random.

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

12 years agoencoding/gob: disable fuzz tests unless command-line flag is set
Rob Pike [Fri, 13 Jul 2012 21:23:51 +0000 (14:23 -0700)]
encoding/gob: disable fuzz tests unless command-line flag is set

They can generate huge amounts of memory, causing failure on
small machines. Also they can be very slow. So slow that one test
was commented out! We uncomment it and use a flag.

Fixes #3742.

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

12 years agoexp/locale/collate: This CL includes the following changes:
Marcel van Lohuizen [Fri, 13 Jul 2012 09:38:22 +0000 (11:38 +0200)]
exp/locale/collate: This CL includes the following changes:
- Changed the representation of colElem to support a few cases
  for some languages not supported by the current format.
- Changed offsets for implicit primary values. This makes the
  values both easier to read and debug (last 4 nibbles are identical to
  implicit primary value) and also results in better packing.
- Fixed bug in weight conversion code that did not pop up yet by
  sheer luck.
Note that tables.go also includes changes to the contraction trie
from CL 6346092.

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

12 years agoexp/locale/collate: adjusted contraction trie to support Myanmar (Burmese),
Marcel van Lohuizen [Fri, 13 Jul 2012 09:38:00 +0000 (11:38 +0200)]
exp/locale/collate: adjusted contraction trie to support Myanmar (Burmese),
which has a rather large contraction table. The value of the next state
offset now starts after the current block, instead of before.  This is
slightly less efficient (on extra addition per state change), but gives
some extra range for the offsets.
Also introduced constants for final (0) and noIndex (0xFF).
tables.go is updated in a separate CL.

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

12 years agocmd/gc: reject use of ... with multiple-valued expressions.
Rémy Oudompheng [Fri, 13 Jul 2012 06:05:41 +0000 (08:05 +0200)]
cmd/gc: reject use of ... with multiple-valued expressions.

Fixes #3334.

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

12 years agoencoding/gob: reduce decoder memory
Rob Pike [Fri, 13 Jul 2012 03:53:17 +0000 (20:53 -0700)]
encoding/gob: reduce decoder memory
Gob decoding reads a whole message into memory and then
copies it into a bytes.Buffer. For large messages this wastes
an entire copy of the message. In this CL, we use a staging
buffer to avoid the large temporary.

Update #2539
RSS drops to 775MB from 1GB.
Active memory drops to 858317048 from 1027878136,
essentially the size of one copy of the input file.

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

12 years agobytes.Buffer: export the Grow method
Rob Pike [Fri, 13 Jul 2012 03:52:19 +0000 (20:52 -0700)]
bytes.Buffer: export the Grow method
Allows a client to pre-allocate buffer space that is known to be necessary,
avoiding expensive reallocations.

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

12 years agocmd/gc: avoid an internal error on invalid type switch.
Rémy Oudompheng [Thu, 12 Jul 2012 21:31:36 +0000 (23:31 +0200)]
cmd/gc: avoid an internal error on invalid type switch.

The error was caused by a call to implements() even when
the type switch variable was not an interface.

Fixes #3786.

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

12 years agocmd/gc: fix error message for type errors involving conversions.
Rémy Oudompheng [Thu, 12 Jul 2012 21:26:52 +0000 (23:26 +0200)]
cmd/gc: fix error message for type errors involving conversions.

Fixes #3818.

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

12 years agomat/big: more optimal Karatsuba threshold
Robert Griesemer [Thu, 12 Jul 2012 21:19:09 +0000 (14:19 -0700)]
mat/big: more optimal Karatsuba threshold

benchmark           old ns/op    new ns/op    delta
BenchmarkHilbert      6253043      6267289   +0.23%
BenchmarkMul         45355940     39490633  -12.93%

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

12 years agomath/big: minor performance tuning
Robert Griesemer [Thu, 12 Jul 2012 21:12:50 +0000 (14:12 -0700)]
math/big: minor performance tuning

Reuse temporary slice to avoid extra allocations
(originally done correctly by remyoudompheng@gmail.com
in https://golang.org/cl/6345075/).

benchmark           old ns/op    new ns/op    delta
BenchmarkHilbert      6252790      6262304   +0.15%
BenchmarkMul         45827438     45301002   -1.15%

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

12 years agoencoding/gob: fix check for short input in slice decode
Rob Pike [Thu, 12 Jul 2012 17:23:54 +0000 (10:23 -0700)]
encoding/gob: fix check for short input in slice decode

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

12 years agomath/big: correct quadratic space complexity in Mul.
Rémy Oudompheng [Thu, 12 Jul 2012 17:18:24 +0000 (10:18 -0700)]
math/big: correct quadratic space complexity in Mul.

The previous implementation used to have a O(n) recursion
depth for unbalanced inputs. A test is added to check that a
reasonable amount of bytes is allocated in this case.

Fixes #3807.

R=golang-dev, dsymonds, gri
CC=golang-dev, remy
https://golang.org/cl/6345075

12 years agocmd/pack: remove unused paging logic
Dave Cheney [Thu, 12 Jul 2012 00:14:07 +0000 (10:14 +1000)]
cmd/pack: remove unused paging logic

This is the remainder of https://golang.org/cl/4601051.

Partially addresses issue 2705.

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

12 years agonet/http: fix Transport race(s) with high GOMAXPROCS
Brad Fitzpatrick [Wed, 11 Jul 2012 23:40:44 +0000 (16:40 -0700)]
net/http: fix Transport race(s) with high GOMAXPROCS

Also adds a new test for GOMAXPROCS=16 explicitly, which now passes
reliably in a stress loop like:

$ go test -c
$ (while ./http.test -test.v -test.run=Concurrency; do echo pass; done ) 2>&1 | tee foo; less foo

(It used to fail very quickly and reliably on at least Linux/amd64)

Fixes #3793

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

12 years agospec: correct typo in string conversion examples.
Rémy Oudompheng [Wed, 11 Jul 2012 18:26:51 +0000 (20:26 +0200)]
spec: correct typo in string conversion examples.

R=golang-dev, dave, r
CC=golang-dev, remy
https://golang.org/cl/6378046

12 years agocrypto/rsa: left-pad PKCS#1 v1.5 outputs.
Adam Langley [Wed, 11 Jul 2012 16:47:12 +0000 (12:47 -0400)]
crypto/rsa: left-pad PKCS#1 v1.5 outputs.

OpenSSL requires that RSA signatures be exactly the same byte-length
as the modulus. Currently it'll reject ~1/256 of our signatures: those
that end up a byte shorter.

Fixes #3796.

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

12 years agowebsite: various html fixes
Dave Cheney [Wed, 11 Jul 2012 16:41:08 +0000 (09:41 -0700)]
website: various html fixes

Fixes #3424.

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

12 years agoencoding/asn1: promote untyped strings to UTF8 as needed.
Adam Langley [Tue, 10 Jul 2012 22:23:30 +0000 (18:23 -0400)]
encoding/asn1: promote untyped strings to UTF8 as needed.

Previously, strings that didn't have an explicit ASN.1 string type
were taken to be ASN.1 PrintableStrings. This resulted in an error if
a unrepresentable charactor was included.

For compatibility reasons, I'm too afraid to switch the default string
type to UTF8String, but this patch causes untyped strings to become
UTF8Strings if they contain a charactor that's not valid in a
PrintableString.

Fixes #3791.

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

12 years agocrypto/x509: exempt broken Entrust certificate from checks.
Adam Langley [Tue, 10 Jul 2012 19:57:51 +0000 (15:57 -0400)]
crypto/x509: exempt broken Entrust certificate from checks.

Entrust have issued a root certificate that's not marked as valid for
signing certificates.

This results in Go programs failing to validate certificates that
chain up to this root (i.e. gateway.push.apple.com:2195).

Although this is clearly a mistake on Entrust's part, it seems that we
will have to bodge around it.

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

12 years agostrconv: extend Grisu3 algorithm to float32.
Rémy Oudompheng [Tue, 10 Jul 2012 05:44:23 +0000 (07:44 +0200)]
strconv: extend Grisu3 algorithm to float32.

Also improve extfloat.Normalize to obtain a modest performance
gain in parsing, and add a shortcut path for exact integers.

benchmark                              old ns/op    new ns/op    delta
BenchmarkAtof64Decimal                        73           73   -0.54%
BenchmarkAtof64Float                          91           91   -0.54%
BenchmarkAtof64FloatExp                      198          180   -9.09%
BenchmarkAtof64Big                           307          308   +0.33%

BenchmarkAtof32Decimal                        72           72   +0.42%
BenchmarkAtof32Float                          83           83   -0.72%
BenchmarkAtof32FloatExp                      212          186  -12.26%
BenchmarkAtof32Random                        262          250   -4.58%

BenchmarkAppendFloatDecimal                  474          305  -35.65%
BenchmarkAppendFloat                         497          489   -1.61%
BenchmarkAppendFloatExp                      493          483   -2.03%
BenchmarkAppendFloatNegExp                   481          481   +0.00%
BenchmarkAppendFloatBig                      667          652   -2.25%

BenchmarkAppendFloat32Integer                338          307   -9.17%
BenchmarkAppendFloat32ExactFraction          364          439  +20.60%
BenchmarkAppendFloat32Point                 1299          490  -62.28%
BenchmarkAppendFloat32Exp                   2593          489  -81.14%
BenchmarkAppendFloat32NegExp                5116          481  -90.60%

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

12 years agosyscall/freebsd: remove Sendfile from unimplemented list
David G. Andersen [Mon, 9 Jul 2012 16:37:56 +0000 (09:37 -0700)]
syscall/freebsd: remove Sendfile from unimplemented list

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

12 years agopkg: Removing duplicated words ("of of", etc.), mostly from comments.
David G. Andersen [Sun, 8 Jul 2012 23:16:10 +0000 (09:16 +1000)]
pkg: Removing duplicated words ("of of", etc.), mostly from comments.

Ran 'double.pl' on the pkg tree to identify doubled words.
One change to an error string return in x509;  the rest are in comments.
Thanks to Matt Jibson for the idea.

R=golang-dev, bsiegert
CC=golang-dev
https://golang.org/cl/6344089

12 years agoA+C: correct Matt Jibson
Matt Jibson [Sun, 8 Jul 2012 02:09:15 +0000 (12:09 +1000)]
A+C: correct Matt Jibson

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

12 years agodoc: various "the the" and other typos
Matthew William Jibson [Sun, 8 Jul 2012 01:57:04 +0000 (11:57 +1000)]
doc: various "the the" and other typos

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

12 years agoA+C: Matthew Jibson (individual CLA).
David Symonds [Sun, 8 Jul 2012 01:56:26 +0000 (11:56 +1000)]
A+C: Matthew Jibson (individual CLA).

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

12 years agocmd/dist: Make verbose messages print to stderr
Pieter Droogendijk [Fri, 6 Jul 2012 05:00:18 +0000 (15:00 +1000)]
cmd/dist: Make verbose messages print to stderr

Made the following changes:
 - Export errprintf() from all three OS-specific modules
 - Added errprintf() to a.h
 - Moved errprintf() in windows.c under xprintf(), since they are so similar
 - Replaced all instances of xprintf() with errprintf() where a vflag check is done
Fixes #3788.

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

12 years agomisc/chrome/gophertool: fix manifest
Shenghou Ma [Thu, 5 Jul 2012 20:52:13 +0000 (16:52 -0400)]
misc/chrome/gophertool: fix manifest
according to http://code.google.com/chrome/extensions/browserAction.html,
it should use "default_popup" instead of "popup".

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

12 years agocmd/cgo: make typedef map traversal order consistent
Shenghou Ma [Thu, 5 Jul 2012 19:24:33 +0000 (15:24 -0400)]
cmd/cgo: make typedef map traversal order consistent
        So that _cgo_gotypes.go will be the same for the same source
        code.

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

12 years agoruntime: move panic/defer/recover-related stuff to a separate file
Dmitriy Vyukov [Wed, 4 Jul 2012 10:52:51 +0000 (14:52 +0400)]
runtime: move panic/defer/recover-related stuff to a separate file
Move panic/defer/recover-related stuff from proc.c/runtime.c to a new file panic.c.
No semantic changes.
proc.c is 1800+ LOC and is a bit difficult to work with.

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

12 years agoreflect: reflect.Zero results are neither addressable nor settable
Robert Griesemer [Tue, 3 Jul 2012 23:06:24 +0000 (16:06 -0700)]
reflect: reflect.Zero results are neither addressable nor settable

This could be deduced from "The Laws of Reflection" but it seems
worthwhile highlighting it.

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

12 years agomath/rand: avoid use of math.Pow in tests.
Rémy Oudompheng [Tue, 3 Jul 2012 22:38:01 +0000 (00:38 +0200)]
math/rand: avoid use of math.Pow in tests.

The use of math.Pow for mere squaring can be extremely
slow on soft-float ARM. Even on systems with hardware
floating-point, a speedup in test duration is observed.

On amd64
Before: ok      math/rand       2.009s
After:  ok      math/rand       0.340s

Fixes #3740.

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

12 years agonet/http: clean up fs tests a bit
Brad Fitzpatrick [Tue, 3 Jul 2012 17:17:55 +0000 (10:17 -0700)]
net/http: clean up fs tests a bit

And fix some govet-caught format arg issues.

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

12 years agoencoding/gob: fix bug in Register
Rob Pike [Tue, 3 Jul 2012 17:05:27 +0000 (10:05 -0700)]
encoding/gob: fix bug in Register
The old code added a star but did not indirect the reflect.Type.

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

12 years agodoc/debugging_with_gdb: mention how to disable gc optimization
Shenghou Ma [Tue, 3 Jul 2012 16:50:03 +0000 (12:50 -0400)]
doc/debugging_with_gdb: mention how to disable gc optimization

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

12 years agosyscall: fix FreeBSD 386 sendfile
David G. Andersen [Tue, 3 Jul 2012 15:16:43 +0000 (08:16 -0700)]
syscall: fix FreeBSD 386 sendfile
The previous version was not handling an off_t (64 bit)
parameter on 32 bit i386 systems.  This patch splits sendfile
into two implementations in their respective arch-specific files.
Tested on FreeBSD amd64 and i386.

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

12 years agoruntime: refactor proc.c
Dmitriy Vyukov [Tue, 3 Jul 2012 08:54:13 +0000 (12:54 +0400)]
runtime: refactor proc.c
1. Rename 'g' and 'm' local vars to 'gp' and 'mp' (convention already used in some functions)
'g' and 'm' are global vars that mean current goroutine and current machine,
when they are shadowed by local vars, it's confusing, no ability to debug log both, etc.
2. White-space shuffling.
No semantic changes.
In preparation to bigger changes.

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

12 years agosyscall: use 32 bits structure for Getrlimit/Setrlimit on 386/ARM.
Han-Wen Nienhuys [Tue, 3 Jul 2012 05:57:32 +0000 (22:57 -0700)]
syscall: use 32 bits structure for Getrlimit/Setrlimit on 386/ARM.

Fixes #2492

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

12 years agocmd/gc: cache itab lookup in convT2I.
Nigel Tao [Mon, 2 Jul 2012 23:09:05 +0000 (09:09 +1000)]
cmd/gc: cache itab lookup in convT2I.

There may be further savings if convT2I can avoid the function call
if the cache is good and T is uintptr-shaped, a la convT2E, but that
will be a follow-up CL.

src/pkg/runtime:
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ISmall             43           15  -64.01%
BenchmarkConvT2IUintptr           45           14  -67.48%
BenchmarkConvT2ILarge            130          101  -22.31%

test/bench/go1:
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    8588997000   8499058000   -1.05%
BenchmarkFannkuch11      5300392000   5358093000   +1.09%
BenchmarkGobDecode         30295580     31040190   +2.46%
BenchmarkGobEncode         18102070     17675650   -2.36%
BenchmarkGzip             774191400    771591400   -0.34%
BenchmarkGunzip           245915100    247464100   +0.63%
BenchmarkJSONEncode       123577000    121423050   -1.74%
BenchmarkJSONDecode       451969800    596256200  +31.92%
BenchmarkMandelbrot200     10060050     10072880   +0.13%
BenchmarkParse             10989840     11037710   +0.44%
BenchmarkRevcomp         1782666000   1716864000   -3.69%
BenchmarkTemplate         798286600    723234400   -9.40%

R=rsc, bradfitz, go.peter.90, daniel.morsing, dave, uriel
CC=golang-dev
https://golang.org/cl/6337058

12 years agomath/big: Remove unnecessary test from nat.go multiplication
David G. Andersen [Mon, 2 Jul 2012 22:30:00 +0000 (15:30 -0700)]
math/big: Remove unnecessary test from nat.go multiplication
The switch at the beginning of the function already ensures n > 1,
so testing for n < 2 is redundant.

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

12 years agoreflect: set GOMAXPROCS=1 in the malloc test
Dmitriy Vyukov [Mon, 2 Jul 2012 16:55:08 +0000 (20:55 +0400)]
reflect: set GOMAXPROCS=1 in the malloc test
Occasionally I see:
--- FAIL: TestAllocations-15 (0.00 seconds)
        all_test.go:1575: 6 mallocs after 100 iterations
Tested:
$ go test -cpu=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 reflect

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

12 years agonet/http: fix comment
Dmitriy Vyukov [Mon, 2 Jul 2012 16:10:31 +0000 (20:10 +0400)]
net/http: fix comment

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

12 years agoimage: fix doc typo
Shenghou Ma [Mon, 2 Jul 2012 03:12:42 +0000 (23:12 -0400)]
image: fix doc typo
     Fixes #3789.

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

12 years agocmd/gc: add missing case for OCOM in defaultlit()
Shenghou Ma [Mon, 2 Jul 2012 01:33:22 +0000 (09:33 +0800)]
cmd/gc: add missing case for OCOM in defaultlit()
        Fixes #3765.

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

12 years agotest: enforce 1 proc in the test
Dmitriy Vyukov [Sun, 1 Jul 2012 17:59:50 +0000 (21:59 +0400)]
test: enforce 1 proc in the test
otherwise it fails spuriously with "newfunc allocated unexpectedly" message
when run with GOMAXPROCS>1 (other goroutine allocates).

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

12 years agoruntime: add freemcache() function
Dmitriy Vyukov [Sun, 1 Jul 2012 09:10:01 +0000 (13:10 +0400)]
runtime: add freemcache() function
It will be required for scheduler that maintains
GOMAXPROCS MCache's.

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

12 years agocmd/go: httpGet function does not use global variable httpClient
Amir Mohammad Saied [Sat, 30 Jun 2012 19:27:57 +0000 (12:27 -0700)]
cmd/go: httpGet function does not use global variable httpClient

No change, just for consistency.

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

12 years agonet/http: ignore malicious or dumb Range requests
Brad Fitzpatrick [Sat, 30 Jun 2012 19:26:06 +0000 (12:26 -0700)]
net/http: ignore malicious or dumb Range requests

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

12 years agoapi: update next.txt
Brad Fitzpatrick [Sat, 30 Jun 2012 19:25:38 +0000 (12:25 -0700)]
api: update next.txt

Some accumulated changes from the past few weeks.

Just cleans up all.bash output.

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

12 years agocmd/dist: Make windows.c's fatal() print to stderr
Pieter Droogendijk [Sat, 30 Jun 2012 14:27:05 +0000 (00:27 +1000)]
cmd/dist: Make windows.c's fatal() print to stderr

Generating env.bat using dist env -wp > env.bat failed silently
if case of an error, because the message was redirected to env.bat.
Verbose messages still go to stdout, causing problems, but that's
a seperate change.
Made errprintf() identical to xprintf(), except for the output handle.
Yes, it's duplicate code, but most of the function is unpacking
the argument list and preparing it for WriteFile(), which has to be
done anyway.

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

12 years agopath/filepath: avoid allocation in Clean of cleaned path even on windows (fix build)
Alex Brainman [Sat, 30 Jun 2012 12:08:53 +0000 (22:08 +1000)]
path/filepath: avoid allocation in Clean of cleaned path even on windows (fix build)

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

12 years agocmd/cgo: generate definitions for GoSlice
Shenghou Ma [Sat, 30 Jun 2012 04:40:07 +0000 (12:40 +0800)]
cmd/cgo: generate definitions for GoSlice
        Fixes #3741.

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

12 years ago misc/emacs: Fix the gofmt patching when the TMPDIR is not the default.
Jean-Marc Eurin [Fri, 29 Jun 2012 16:49:31 +0000 (12:49 -0400)]
misc/emacs: Fix the gofmt patching when the TMPDIR is not the default.

The previous code assumed the gofmt output referred to /tmp but
that's not true if TMPDIR points somewhere else (like on Macs).
Fixes #3782.

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

12 years agonet/http: support multiple byte ranges in ServeContent
Brad Fitzpatrick [Fri, 29 Jun 2012 14:44:04 +0000 (07:44 -0700)]
net/http: support multiple byte ranges in ServeContent

Fixes #3784

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

12 years agonet/http: Fix a verb-tense mismatch and a typo in documentation.
Andrey Mirtchovski [Thu, 28 Jun 2012 22:18:35 +0000 (15:18 -0700)]
net/http: Fix a verb-tense mismatch and a typo in documentation.

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

12 years agogo/parser: minor internal cleanups
Robert Griesemer [Thu, 28 Jun 2012 19:22:47 +0000 (12:22 -0700)]
go/parser: minor internal cleanups

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

12 years agogo spec: clean up section on selectors
Robert Griesemer [Thu, 28 Jun 2012 19:22:24 +0000 (12:22 -0700)]
go spec: clean up section on selectors

- point out difference between selectors and qualified identifiers
- differentiate between illegal selectors and run-time panics
- use "indirect" as opposed to "dereference" consistently
- add extra links

Fixes #3779.

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

12 years agopath/filepath: add test case for rooted ".."
Han-Wen Nienhuys [Thu, 28 Jun 2012 16:46:44 +0000 (09:46 -0700)]
path/filepath: add test case for rooted ".."

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

12 years agosyscall: add missing argument type
Joe Poirier [Wed, 27 Jun 2012 23:21:48 +0000 (18:21 -0500)]
syscall: add missing argument type

And update implementation location comment.

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

12 years agoimage/jpeg: support for reading 4:4:0 subsampling.
Mathieu Lonjaret [Wed, 27 Jun 2012 21:37:17 +0000 (14:37 -0700)]
image/jpeg: support for reading 4:4:0 subsampling.
Updates #2362.

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

12 years agoruntime: fix string optimization
Russ Cox [Wed, 27 Jun 2012 21:32:41 +0000 (17:32 -0400)]
runtime: fix string optimization

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

12 years agoruntime: avoid allocation for "" + x + ""
Russ Cox [Wed, 27 Jun 2012 21:06:49 +0000 (17:06 -0400)]
runtime: avoid allocation for "" + x + ""

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

12 years agonet: fix build (FreeBSD sendfile)
Russ Cox [Wed, 27 Jun 2012 21:02:39 +0000 (17:02 -0400)]
net: fix build (FreeBSD sendfile)

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/6358043

12 years agopath/filepath: avoid allocation in Clean of cleaned path
Russ Cox [Wed, 27 Jun 2012 20:52:36 +0000 (16:52 -0400)]
path/filepath: avoid allocation in Clean of cleaned path

Alternative to https://golang.org/cl/6330044.

Fixes #3681.

R=golang-dev, r, hanwen, iant
CC=golang-dev
https://golang.org/cl/6335056

12 years agoruntime: add goroutine creation benchmark
Dmitriy Vyukov [Wed, 27 Jun 2012 17:57:49 +0000 (21:57 +0400)]
runtime: add goroutine creation benchmark
Current results on 2 core darwin/amd64:
BenchmarkGoroutineChain 351 ns/op
BenchmarkGoroutineChain-2 3840 ns/op
BenchmarkGoroutineChain-4 4040 ns/op
BenchmarkConcGoroutineChain 350 ns/op
BenchmarkConcGoroutineChain-2 875 ns/op
BenchmarkConcGoroutineChain-4 2027 ns/op

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

12 years agogo spec: clean up use of QualifiedIdent production.
Robert Griesemer [Tue, 26 Jun 2012 18:49:19 +0000 (11:49 -0700)]
go spec: clean up use of QualifiedIdent production.

Fixes #3763.

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

12 years agosyscall: fix build
Russ Cox [Tue, 26 Jun 2012 00:45:18 +0000 (20:45 -0400)]
syscall: fix build

I missed the API change in the last FreeBSD CL, but the tool caught it.

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/6331063

12 years agonet/http: provide access to POST-only form values
Patrick Mylund Nielsen [Tue, 26 Jun 2012 00:41:46 +0000 (20:41 -0400)]
net/http: provide access to POST-only form values

Fixes #3630.

R=rsc
CC=bradfitz, dsymonds, golang-dev, rodrigo.moraes
https://golang.org/cl/6210067

12 years agosyscall, net: sendfile for FreeBSD
L Campbell [Tue, 26 Jun 2012 00:26:19 +0000 (20:26 -0400)]
syscall, net: sendfile for FreeBSD

R=golang-dev, rsc, bradfitz, devon.odell
CC=golang-dev
https://golang.org/cl/6221054

12 years agoA+C: L Campbell (individual CLA)
Russ Cox [Tue, 26 Jun 2012 00:25:59 +0000 (20:25 -0400)]
A+C: L Campbell (individual CLA)

Guess I was wrong about being done for the day.

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

12 years agofmt: set p.field before nil check
Rob Pike [Mon, 25 Jun 2012 23:48:20 +0000 (16:48 -0700)]
fmt: set p.field before nil check
Fixes #3752.

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

12 years agoruntime: add arm soft division and modulo benchmarks
Dave Cheney [Mon, 25 Jun 2012 22:58:00 +0000 (08:58 +1000)]
runtime: add arm soft division and modulo benchmarks

arm soft div and mod performance plays an important part
in runtime performance.

The currently implementation is very stable, but we believe
we can best it. This benchmark provides a reference point.

linux/arm omap4 pandaboard

BenchmarkUint32Div7     10000000               298 ns/op
BenchmarkUint32Div37    10000000               298 ns/op
BenchmarkUint32Div123   10000000               298 ns/op
BenchmarkUint32Div763   10000000               298 ns/op
BenchmarkUint32Div1247  10000000               299 ns/op
BenchmarkUint32Div9305  10000000               298 ns/op
BenchmarkUint32Div13307 10000000               298 ns/op
BenchmarkUint32Div52513 10000000               298 ns/op
BenchmarkUint32Div60978747      10000000               298 ns/op
BenchmarkUint32Div106956295     10000000               297 ns/op
BenchmarkUint32Mod7     10000000               280 ns/op
BenchmarkUint32Mod37    10000000               280 ns/op
BenchmarkUint32Mod123   10000000               280 ns/op
BenchmarkUint32Mod763   10000000               280 ns/op
BenchmarkUint32Mod1247  10000000               280 ns/op
BenchmarkUint32Mod9305  10000000               280 ns/op
BenchmarkUint32Mod13307 10000000               280 ns/op
BenchmarkUint32Mod52513 10000000               280 ns/op
BenchmarkUint32Mod60978747      10000000               280 ns/op
BenchmarkUint32Mod106956295     10000000               280 ns/op

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

12 years ago doc: drop video title from homepage
Andrew Gerrand [Mon, 25 Jun 2012 21:54:26 +0000 (14:54 -0700)]
  doc: drop video title from homepage

It's just stutter.

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

12 years agoencoding/json: add Number type
Jonathan Gold [Mon, 25 Jun 2012 21:36:09 +0000 (17:36 -0400)]
encoding/json: add Number type

Number represents the actual JSON text,
preserving the precision and
formatting of the original input.

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

12 years agoA+C: Jonathan Gold (individual CLA)
Russ Cox [Mon, 25 Jun 2012 21:36:02 +0000 (17:36 -0400)]
A+C: Jonathan Gold (individual CLA)

This is my last one for today, I hope!

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

12 years agonet: fix lookup of AAAA-only hosts without cgo
Michael Stapelberg [Mon, 25 Jun 2012 21:32:39 +0000 (17:32 -0400)]
net: fix lookup of AAAA-only hosts without cgo

Fixes #3762.

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

12 years agoA+C: add Michael Stapelberg (individual CLA)
Russ Cox [Mon, 25 Jun 2012 21:32:31 +0000 (17:32 -0400)]
A+C: add Michael Stapelberg (individual CLA)

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

12 years agogo/build: fix doc typo
Pieter Droogendijk [Mon, 25 Jun 2012 21:20:48 +0000 (17:20 -0400)]
go/build: fix doc typo

go/build section "Build Constraints", first paragraph said:
  "... they must be appear near the top of the file ..."
fixed to:
  "... they must appear near the top of the file ..."

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

12 years agomisc/chrome/gophertool: Support for manifest version 1 is being phased out.
Amir Mohammad Saied [Mon, 25 Jun 2012 21:19:08 +0000 (17:19 -0400)]
misc/chrome/gophertool: Support for manifest version 1 is being phased out.

Manifest version 1 was deprecated in Chrome 18, and support will be phased
out according to the schedule available at:
http://code.google.com/chrome/extensions/manifestVersion.html

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

12 years agoencoding/base32, encoding/base64: removed unneeded break label
Thomas Alan Copeland [Mon, 25 Jun 2012 21:18:50 +0000 (17:18 -0400)]
encoding/base32, encoding/base64: removed unneeded break label

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

12 years agoA+C: Amir Mohammad Saied, Thomas Alan Copeland (both individual CLA)
Russ Cox [Mon, 25 Jun 2012 21:18:44 +0000 (17:18 -0400)]
A+C: Amir Mohammad Saied, Thomas Alan Copeland (both individual CLA)

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

12 years agogofmt: handle comments correctly in rewrites
Robert Griesemer [Mon, 25 Jun 2012 20:58:28 +0000 (13:58 -0700)]
gofmt: handle comments correctly in rewrites

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

12 years agoencoding/json: simplify (*decodeState).indirect
Micah Stetson [Mon, 25 Jun 2012 20:03:18 +0000 (16:03 -0400)]
encoding/json: simplify (*decodeState).indirect

Removes an incorrect code comment and some superfluous variables.

The comment I removed says that struct fields which implement
Unmarshaler must be pointers, even if they're in an addressable
struct. That's not the case, and there's already a test in decode_test.go
that demonstrates as much.

Encoding/json has quite a few assignments of reflect.Values to extra
variables – things like "iv := v" when there's no need to make a copy. I
think these are left over from a previous version of the reflect API. If they
aren't wanted, I wouldn't mind going through the package and getting
rid of the rest of them.

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

12 years agoencoding/csv, encoding/xml: report write errors
Jan Ziak [Mon, 25 Jun 2012 20:00:35 +0000 (16:00 -0400)]
encoding/csv, encoding/xml: report write errors

Fixes #3773.

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

12 years agospec: clarify receive operator
Robert Griesemer [Mon, 25 Jun 2012 18:28:24 +0000 (11:28 -0700)]
spec: clarify receive operator

- receiving from a closed channel returns immediately
- in the ,ok form, the 2nd result is of type bool, not
  just boolean (gc and ggcgo agree).

Per dsymonds' suggestion.

R=r, rsc, ken, iant, dsymonds
CC=golang-dev
https://golang.org/cl/6333057

12 years agogo/ast: minor comment maps API change
Robert Griesemer [Mon, 25 Jun 2012 18:27:54 +0000 (11:27 -0700)]
go/ast: minor comment maps API change

This is a new, not yet committed API.

- Changed NewCommentMap to be independent of
  *File nodes and more symmetric with the
  Filter and Comments methods.

- Implemented Update method for use in
  AST modifications.

- Implemented String method for debugging

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

12 years agoexp/inotify: prevent data race
Jan Ziak [Mon, 25 Jun 2012 18:08:09 +0000 (14:08 -0400)]
exp/inotify: prevent data race
Fixes #3713.

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

12 years agonet/http: speed up Header.WriteSubset
Brad Fitzpatrick [Mon, 25 Jun 2012 15:54:36 +0000 (08:54 -0700)]
net/http: speed up Header.WriteSubset

A few performance improvements, but without the stack sorting
change to avoid allocating, which is instead waiting on better
escape analysis.

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

12 years agoruntime: remove memset/memclr shim
Dave Cheney [Mon, 25 Jun 2012 13:01:34 +0000 (23:01 +1000)]
runtime: remove memset/memclr shim

This CL resolves https://golang.org/cl/6300043/#msg3
by renaming memset_arm.s to memclr_arm.s and merging the function
of the same name from asm_arm.s.

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

12 years agoruntime: fix potential GC deadlock
Dmitriy Vyukov [Mon, 25 Jun 2012 07:08:09 +0000 (11:08 +0400)]
runtime: fix potential GC deadlock
The issue seems to not be triggered right now,
but I've seen the deadlock after some other legal
modifications to runtime.
So I think we are safer this way.

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

12 years agoruntime: detect hash map collision problems
Russ Cox [Sun, 24 Jun 2012 23:47:50 +0000 (19:47 -0400)]
runtime: detect hash map collision problems

This can only happen if the hash function we're using is getting
far more than it's fair share of collisions, but that has happened
to us repeatedly as we've expanded the allowed use cases for
hash tables (issue 1544, issue 2609, issue 2630, issue 2883, issue 3695).
Maybe this will help the next time we try something new.

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

12 years agomath: improve Atan, Asin and Acos accuracy
Charles L. Dorian [Sun, 24 Jun 2012 23:39:07 +0000 (19:39 -0400)]
math: improve Atan, Asin and Acos accuracy

pkg/math/all_test.go tests Atan (and therefore Asin and Acos) to a
relative accuracy of 4e-16, but the test vector misses values where
the old algorithm was in error by more than that. For example:

x            newError   oldError
0.414215746  1.41e-16  -4.24e-16
0.414216076  1.41e-16  -4.24e-16
0.414217632  1.41e-16  -4.24e-16
0.414218770  1.41e-16  -4.24e-16
0.414225466  0         -5.65e-16
0.414226244  1.41e-16  -4.24e-16
0.414228756  0         -5.65e-16
0.414235089  0         -5.65e-16
0.414237070  0         -5.65e-16

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

12 years agoos: make POSIX StartProcess work with chroot again.
Han-Wen Nienhuys [Sun, 24 Jun 2012 23:34:06 +0000 (19:34 -0400)]
os: make POSIX StartProcess work with chroot again.

Skip directory check in startProcess in the presence of
SysProcAttr.

Fixes #3649.

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