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

7380 Commits

Author SHA1 Message Date
Dmitriy Vyukov
e5b0bcebdb runtime/debug: deflake TestFreeOSMemory
This is followup to https://golang.org/cl/7319050/

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7379043
2013-02-20 12:34:16 +04:00
Dmitriy Vyukov
06a488fa97 runtime: fix deadlock detector false negative
Fixes #4819.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7322086
2013-02-20 12:15:02 +04:00
Dmitriy Vyukov
a92e11a256 runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again
and again.
This is https://golang.org/cl/7310096 but with return instead of break
in the nested switch.
Fixes #4820.

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/7304102
2013-02-20 12:13:04 +04:00
Péter Surányi
b4109f801a path/filepath, os/exec: unquote PATH elements on Windows
On Windows, directory names in PATH can be fully or partially quoted
in double quotes ('"'), but the path names as used by most APIs must
be unquoted. In addition, quoted names can contain the semicolon
(';') character, which is otherwise used as ListSeparator.

This CL changes SplitList in path/filepath and LookPath in os/exec
to only	treat unquoted semicolons as separators, and to unquote the
separated elements.

(In addition, fix harmless test bug I introduced for LookPath on Unix.)

Related discussion thread:
https://groups.google.com/d/msg/golang-nuts/PXCr10DsRb4/sawZBM7scYgJ

R=rsc, minux.ma, mccoyst, alex.brainman, iant
CC=golang-dev
https://golang.org/cl/7181047
2013-02-20 16:19:52 +11:00
Brian Dellisanti
e378aef1de windows: fix syscall.SidTypeUser so following consts have correct values.
Fixes #4844.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/7366043
2013-02-20 15:38:35 +11:00
Carl Shapiro
7f9c02a10d runtime: add conversion specifier to printf for char values
R=r, golang-dev
CC=golang-dev
https://golang.org/cl/7327053
2013-02-19 18:05:44 -08:00
Akshat Kumar
66b69a1719 net: Plan 9: open data file and set remote-addr properly
The data file should be opened when a Conn is first
established, rather than waiting for the first Read or
Write.

Upon Close, we now make sure to try to close both, the
ctl as well as data files and set both to nil, even in
the face of errors, instead of returning early.

The Accept call was not setting the remote address
of the connection properly. Now, we read the correct
file.

Make functions that establish Conn use newTCPConn
or newUDPConn.

R=rsc, rminnich, ality, dave
CC=golang-dev
https://golang.org/cl/7228068
2013-02-19 17:11:17 -08:00
Mikio Hara
40c2fbf4f2 net: set up IPv6 scoped addressing zone for network facilities
This CL changes nothing to existing API behavior, just sets up
Zone in IPNet and IPAddr structures if possible.

Also does small simplification.

Update #4234.

R=rsc, dave
CC=golang-dev
https://golang.org/cl/7300081
2013-02-20 08:18:04 +09:00
Mikio Hara
e4890e57e1 net: return correct point-to-point interface address on linux
On Linux point-to-point interface an IFA_ADDRESS attribute
represents a peer address. For a correct interface address
we should take an IFA_LOCAL attribute instead.

Fixes #4839.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7352045
2013-02-20 07:31:44 +09:00
Alan Donovan
a17c46169f go/types: include package import path in NamedType.String().
This avoids ambiguity and makes the diagnostics closer to
those issued by gc, but it is more verbose since it qualifies
intra-package references.

Without extra context---e.g. a 'from *Package' parameter to
Type.String()---we are forced to err on one side or the other.

Also, cosmetic changes to exp/ssa:
- Remove package-qualification workaround in Function.FullName.
- Always set go/types.Package.Path field to the import path,
  since we know the correct path at this point.
- In Function.DumpTo, show variadic '...' and result type info,
  and delete now-redundant "# Type: " line.

R=gri
CC=golang-dev
https://golang.org/cl/7325051
2013-02-19 14:42:05 -05:00
Robert Griesemer
5c3fb96be9 exp/README: update README
R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/7323073
2013-02-19 11:21:18 -08:00
Robert Griesemer
3ee87d02b0 cmd/godoc: use go/build to determine package and example files
Also:
- faster code for example extraction
- simplify handling of command documentation:
  all "main" packages are treated as commands
- various minor cleanups along the way

For commands written in Go, any doc.go file containing
documentation must now be part of package main (rather
then package documentation), otherwise the documentation
won't show up in godoc (it will still build, though).

For commands written in C, documentation may still be
in doc.go files defining package documentation, but the
recommended way is to explicitly ignore those files with
a +build ignore constraint to define package main.

Fixes #4806.

R=adg, rsc, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7333046
2013-02-19 11:19:58 -08:00
Kamil Kisiel
0456729977 path/filepath: add examples for SplitList and Rel.
R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7291043
2013-02-19 10:41:35 -08:00
Russ Cox
6df181a7f0 path/filepath: document Dir better
This comment matches the one in path.

Fixes #4837.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7305100
2013-02-19 13:24:03 -05:00
Andrew Wilkins
1fe8fdf708 go/types: Use left-hand side's type as hint for right-hand
side expression evaluation in assignment operations.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/7349046
2013-02-19 09:20:56 -08:00
Robin Eklind
7fdaec6c2f debug/dwarf: add flag_present attribute encoding.
ref: http://www.dwarfstd.org/doc/DWARF4.pdf

Update #4829

R=minux.ma, iant
CC=dave, golang-dev
https://golang.org/cl/7354043
2013-02-20 00:58:31 +08:00
Donovan Hide
937f91e1da strings: faster Count, Index
Slightly better benchmarks for when string and separator are equivalent and also less branching in inner loops.
benchmark                        old ns/op    new ns/op    delta
BenchmarkGenericNoMatch               3430         3442   +0.35%
BenchmarkGenericMatch1               23590        22855   -3.12%
BenchmarkGenericMatch2              108031       105025   -2.78%
BenchmarkSingleMaxSkipping            2969         2704   -8.93%
BenchmarkSingleLongSuffixFail         2826         2572   -8.99%
BenchmarkSingleMatch                205268       197832   -3.62%
BenchmarkByteByteNoMatch               987          921   -6.69%
BenchmarkByteByteMatch                2014         1749  -13.16%
BenchmarkByteStringMatch              3083         3050   -1.07%
BenchmarkHTMLEscapeNew                 922          915   -0.76%
BenchmarkHTMLEscapeOld                1654         1570   -5.08%
BenchmarkByteByteReplaces            11897        11556   -2.87%
BenchmarkByteByteMap                  4485         4255   -5.13%
BenchmarkIndexRune                     174          121  -30.46%
BenchmarkIndexRuneFastPath              41           41   -0.24%
BenchmarkIndex                          45           44   -0.22%
BenchmarkMapNoChanges                  433          431   -0.46%
BenchmarkIndexHard1                4015336      3316490  -17.40%
BenchmarkIndexHard2                3976254      3395627  -14.60%
BenchmarkIndexHard3                3973158      3378329  -14.97%
BenchmarkCountHard1                4403549      3448512  -21.69%
BenchmarkCountHard2                4387437      3413059  -22.21%
BenchmarkCountHard3                4403891      3382661  -23.19%
BenchmarkIndexTorture                28354        25864   -8.78%
BenchmarkCountTorture                29625        27463   -7.30%
BenchmarkFields                   38752040     39169840   +1.08%
BenchmarkFieldsFunc               38797765     38888060   +0.23%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkSingleMaxSkipping         3367.07      3697.62    1.10x
BenchmarkSingleLongSuffixFail       354.51       389.47    1.10x
BenchmarkSingleMatch                 73.07        75.82    1.04x
BenchmarkFields                      27.06        26.77    0.99x
BenchmarkFieldsFunc                  27.03        26.96    1.00x

R=dave, fullung, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/7350045
2013-02-19 10:36:15 -05:00
Russ Cox
cb32ea9c19 runtime: replace bubble sort with heap sort in select
R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/7304106
2013-02-19 10:15:13 -05:00
Russ Cox
a6db2a8517 reflect: document tie-breaking in Select
The exact words are taken from the spec.

Fixes some confusion on golang-nuts.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7353044
2013-02-19 10:13:53 -05:00
Robin Eklind
d137a2cb56 src: use internal tests if possible
If a test can be placed in the same package ("internal"), it is placed
there. This facilitates testing of package-private details. Because of
dependency cycles some packages cannot be tested by internal tests.

R=golang-dev, rsc, mikioh.mikioh
CC=golang-dev, r
https://golang.org/cl/7323044
2013-02-19 10:02:01 -05:00
Volker Dobler
6ab113531b exp/cookiejar: store cookies under TLD+1 on nil public suffix list
The current implementation would store all cookies received from
any .com domain under "com" in the entries map if a nil public
suffix list is used in constructing the Jar. This is inefficient.

This CL uses the TLD+1 of the domain if the public suffix list
is nil which has two advantages:
 - It uses the entries map efficiently.
 - It prevents a host foo.com to set cookies for bar.com.
   (It may set the cookie, but it won't be returned to bar.com.)
A domain like www.british-library.uk may still set a domain
cookie for .british-library.uk in this case.

The behavior for a non-nil public suffix list is unchanged, cookies
are stored under eTLD+1 in this case.

R=nigeltao
CC=golang-dev
https://golang.org/cl/7312105
2013-02-19 19:12:36 +11:00
Andrew Wilkins
68ff170ebe go/types: Permit dereferencing of named pointer types.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/7358044
2013-02-18 19:03:10 -08:00
Robert Griesemer
95aaca6708 go/types: Pkg *Package field for all objects
The field is nil for predeclared (universe)
objects and parameter/result variables.

R=adonovan
CC=golang-dev
https://golang.org/cl/7312093
2013-02-18 14:40:47 -08:00
Russ Cox
86d509b463 runtime: preparation for non-Go threads running Go code
* Handle p==nil in signalstack by setting SS_DISABLE flag.
* Make minit only allocate a signal g if there's not one already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7323072
2013-02-18 13:43:12 -05:00
Dmitriy Vyukov
d62239b5f6 runtime/debug: make TestFreeOSMemory repeatable
Fixes #4835.

R=golang-dev, fullung
CC=golang-dev
https://golang.org/cl/7319050
2013-02-18 15:46:36 +04:00
Volker Dobler
6bbd12f176 exp/cookiejar: make cookie sorting deterministic.
Re-enable TestUpdateAndDelete, TestExpiration, TestChromiumDomain and
TestChromiumDeletion on Windows.

Sorting of cookies with same path length and same creation
time is done by an additional seqNum field.
This makes the order in which cookies are returned in Cookies
deterministic, even if the system clock is manipulated or on
systems with a low-resolution clock.

The tests now use a synthetic time: This makes cookie testing
reliable in case of bogus system clocks and speeds up the
expiration tests.

R=nigeltao, alex.brainman, dave
CC=golang-dev
https://golang.org/cl/7323063
2013-02-18 11:27:41 +11:00
Joel Sing
556dd0bfbd runtime: fix sigaction struct on freebsd
Fix the sa_mask member of the sigaction struct - on FreeBSD this is
declared as a sigset_t, which is an array of four unsigned ints.
Replace the current int64 with Sigset from defs_freebsd_GOARCH, which
has the correct definition.

Unbreaks the FreeBSD builds.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/7333047
2013-02-18 03:23:29 +11:00
Rémy Oudompheng
23093f86ee strings: better mean complexity for Count and Index.
The O(n+m) complexity is obtained probabilistically
by using Rabin-Karp algorithm, which provides the needed complexity
unless exceptional collisions occur, without memory allocation.

benchmark                 old ns/op    new ns/op    delta
BenchmarkIndexHard1         6532331      4045886  -38.06%
BenchmarkIndexHard2         8178173      4038975  -50.61%
BenchmarkIndexHard3         6973687      4042591  -42.03%
BenchmarkCountHard1         6270864      4071090  -35.08%
BenchmarkCountHard2         7838039      4072853  -48.04%
BenchmarkCountHard3         6697828      4071964  -39.20%
BenchmarkIndexTorture       2730546        28934  -98.94%
BenchmarkCountTorture       2729622        29064  -98.94%

Fixes #4600.

R=rsc, donovanhide, remyoudompheng
CC=golang-dev
https://golang.org/cl/7314095
2013-02-17 13:07:17 +01:00
Georg Reinke
f1037f0e86 runtime: fix build on openbsd
R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/7312104
2013-02-17 02:06:59 +11:00
Mikio Hara
c02d18ab34 net: add IPConn through Conn test
Also refactors mock ICMP stuff.

R=dave, rsc
CC=golang-dev
https://golang.org/cl/7325043
2013-02-16 12:55:39 +09:00
Dave Cheney
21327e1970 runtime: fix unused variable warning
R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/7312103
2013-02-16 14:32:04 +11:00
Russ Cox
60526ca6d1 undo CL 7310096 / 59da6744d66d
broke windows build

««« original CL description
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.

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

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/7343050
2013-02-15 17:54:46 -05:00
Russ Cox
c92d3552e5 os: point users of ProcessState.SysUsage to getrusage(2)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7352044
2013-02-15 17:11:13 -05:00
Russ Cox
0c3b17a55a runtime: allow mem profiles with GOGC=off
Fixes #3586.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7304098
2013-02-15 14:48:58 -05:00
Russ Cox
6c1539bb01 runtime: show frame pointer values during throw
Should help if stack overflows start happening again.

Fixes #3582.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7311098
2013-02-15 14:48:47 -05:00
Russ Cox
c8214c78bd runtime: make return from main wait for active panic
Arguably if this happens the program is buggy anyway,
but letting the panic continue looks better than interrupting it.
Otherwise things like this are possible, and confusing:

$ go run x.go
panic: $ echo $?
0
$

Fixes #3934.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7322083
2013-02-15 14:48:35 -05:00
Russ Cox
318309a51f runtime/pprof: adjust reported line numbers to show call sites
This is the same logic used in the standard tracebacks.
The caller pc is the pc after the call, so except in the
fake "call" caused by a panic, back up the pc enough
that the lookup will use the previous instruction.

Fixes #4150.
Fixes #4151.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7317047
2013-02-15 14:27:16 -05:00
Russ Cox
8a6ff3ab34 runtime: allocate heap metadata at run time
Before, the mheap structure was in the bss,
but it's quite large (today, 256 MB, much of
which is never actually paged in), and it makes
Go binaries run afoul of exec-time bss size
limits on some BSD systems.

Fixes #4447.

R=golang-dev, dave, minux.ma, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/7307122
2013-02-15 14:27:03 -05:00
Dmitriy Vyukov
f87b7f67b2 runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7310096
2013-02-15 22:22:13 +04:00
Russ Cox
d3d89ae7d2 runtime: check rt_sigaction return values on linux
(If the mask size is wrong the system call fails.)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7305097
2013-02-15 13:13:19 -05:00
Russ Cox
2b9787c2f3 encoding/binary: make type error more specific
Right now it says 'invalid type S' for a struct type S.
Instead, say which type inside the struct is the problem.

Fixes #4825.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7301102
2013-02-15 13:12:28 -05:00
Russ Cox
d47cc872b5 exp/cookiejar: fix windows/386 build
More mysteriously broken tests.

TBR=nigeltao
CC=golang-dev
https://golang.org/cl/7342048
2013-02-15 12:43:28 -05:00
Russ Cox
c7f7bbbf03 runtime: fix build on linux
In addition to the compile failure fixed in signal*.c,
preserving the signal mask led to very strange crashes.
Testing shows that looking for SIG_IGN is all that
matters to get along with nohup, so reintroduce
sigset_zero instead of trying to preserve the signal mask.

TBR=iant
CC=golang-dev
https://golang.org/cl/7323067
2013-02-15 12:18:33 -05:00
Russ Cox
f8f2727ab5 exp/cookiejar: fix windows builder
TBR=nigeltao
CC=golang-dev
https://golang.org/cl/7322084
2013-02-15 11:32:31 -05:00
Russ Cox
f3407f445d runtime: fix running under nohup
There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:

* Make sure to preserve the inherited signal mask at
minit instead of clearing it.

* If the SIGHUP handler is SIG_IGN, leave it that way.

Fixes #4491.

R=golang-dev, mikioh.mikioh, iant
CC=golang-dev
https://golang.org/cl/7308102
2013-02-15 11:18:55 -05:00
Adam Langley
5b20a18f3b crypto/x509: support IP SANs.
Subject Alternative Names in X.509 certificates may include IP
addresses. This change adds support for marshaling, unmarshaling and
verifying this form of SAN.

It also causes IP addresses to only be checked against IP SANs,
rather than against hostnames as was previously the case. This
reflects RFC 6125.

Fixes #4658.

R=golang-dev, mikioh.mikioh, bradfitz
CC=golang-dev
https://golang.org/cl/7336046
2013-02-15 10:40:17 -05:00
Dmitriy Vyukov
a9824f178d runtime: fix debug output
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7312101
2013-02-15 17:04:02 +04:00
Alex Brainman
d844001601 mime: do not test for .wav on windows
Even builders don't have that mime type

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7314106
2013-02-15 16:55:51 +11:00
Alex Brainman
f9dbbdb1d3 mime: use .wav instead of .bmp during windows tests
Some systems do not have .bmp mime.

Update #4723.

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7326047
2013-02-15 15:52:54 +11:00
Alex Brainman
d71b3921f7 net: delete TestDialTimeoutHandleLeak
It is too flaky. Tried to make it more reliable,
but that affects other tests (they run too long),
because we do unusual things here, like attempting
to connect to non-existing address and interrupt.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7314097
2013-02-15 15:52:12 +11:00
Alan Donovan
e49f945603 runtime: expand error for signal received on non-Go thread.
We call runtime.findnull dynamically to avoid exceeding the
static nosplit stack limit check.  (Thanks minux!)

Fixes #4048.

R=rsc, minux.ma, ality
CC=golang-dev
https://golang.org/cl/7232066
2013-02-14 23:37:14 -05:00
Cosmos Nicolaou
d0f3475fda go/doc: add support for arbitrary notes
Add support for arbitrary notes of the form // MARKER(userid): comment
in the same vein as BUG(userid): A marker must be two or more upper case [A-Z] letters.

R=gri, rsc, bradfitz, jscrockett01
CC=golang-dev
https://golang.org/cl/7322061
2013-02-14 20:20:32 -08:00
Rémy Oudompheng
7c5bd322d5 log/syslog: fix channel race in test.
R=golang-dev, minux.ma, iant, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7314057
2013-02-15 11:07:31 +11:00
Robert Griesemer
5b1885c241 go/parser: cleanups following CL 7307085
- use the new AllErrors flag where appropriate
- unless AllErrors is set, eliminate spurious
  errors before they are added to the errors list
  (it turns out that reporting spurious errors always
  leads to too many uninformative errors after all)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7323065
2013-02-14 13:36:40 -08:00
Dmitriy Vyukov
6a828482fa runtime: add more tests for LockOSThread()
Just test some additional paths through the scheduler.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7331044
2013-02-15 00:02:12 +04:00
Russ Cox
30359a55c2 encoding/json: document and test use of unicode.ReplacementChar
Fixes #4783.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7314099
2013-02-14 14:56:01 -05:00
Russ Cox
d340a89d9c encoding/json: roll back Unmarshal optimization + test
The second attempt at the Unmarshal optimization allowed
panics to get out of the json package. Add test for that bug
and remove the optimization.

Let's stop trying to optimize Unmarshal.

Fixes #4784.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7300108
2013-02-14 14:46:15 -05:00
Russ Cox
da6207f7a4 go/types: avoid os.Getwd if not necessary
Getwd can be very expensive.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7312100
2013-02-14 14:46:03 -05:00
Michael Matloob
2cd96806f4 go/parser: stop ParseFile after ten errors.
There wil be a panic if more than ten errors are encountered. ParseFile
will recover and return the ErrorList.

Fixes #3943.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/7307085
2013-02-14 11:26:21 -08:00
Brad Fitzpatrick
248d1446b5 syscall: don't make //sys lines be doc comments
Cleans up godoc and makes it consistent. (some had it, some
didn't)

This still keeps the information there, though, for people
looking at the source directly.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7324056
2013-02-14 11:23:58 -08:00
Russ Cox
89fde30fbd os: cache Getwd result as hint for next time
Avoids the dot-dot-based algorithm on repeated calls
when the directory hasn't changed.

R=golang-dev, iant, bradfitz
CC=golang-dev
https://golang.org/cl/7340043
2013-02-14 14:21:09 -05:00
Brad Fitzpatrick
158a0353f7 net: document OpError
Fixes #4797

R=adg, rsc
CC=golang-dev
https://golang.org/cl/7300099
2013-02-14 09:29:34 -08:00
Volker Dobler
8e7d156237 exp/cookiejar: implement Cookies and provided tests
This CL provides the implementation of Cookies and
the complete test suite. Several tests have been ported
from the Chromium project as a cross check.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7311073
2013-02-14 19:41:58 +11:00
Dmitriy Vyukov
691455f780 runtime: move stack management related code to stack.c
No code changes.
This is mainly in preparation to scheduler changes,
oldstack/newstack are not related to scheduling.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7311085
2013-02-14 12:37:55 +04:00
Dave Cheney
2803744b86 net/textproto: more efficient header parsing
A co creation with bradfitz

* add fast path for header lines which are not continuations
* pass hint to better size initial mime header map

lucky(~/go/src/pkg/net/http) % ~/go/misc/benchcmp {golden,new}.txt
benchmark                          old ns/op    new ns/op    delta
BenchmarkReadRequestChrome             10073         8348  -17.12%
BenchmarkReadRequestCurl                4368         4350   -0.41%
BenchmarkReadRequestApachebench         4412         4397   -0.34%
BenchmarkReadRequestSiege               6431         5924   -7.88%
BenchmarkReadRequestWrk                 2820         3146  +11.56%

benchmark                           old MB/s     new MB/s  speedup
BenchmarkReadRequestChrome             60.66        73.18    1.21x
BenchmarkReadRequestCurl               17.85        17.93    1.00x
BenchmarkReadRequestApachebench        18.58        18.65    1.00x
BenchmarkReadRequestSiege              23.48        25.49    1.09x
BenchmarkReadRequestWrk                14.18        12.71    0.90x

benchmark                         old allocs   new allocs    delta
BenchmarkReadRequestChrome                32           26  -18.75%
BenchmarkReadRequestCurl                  15           15    0.00%
BenchmarkReadRequestApachebench           16           15   -6.25%
BenchmarkReadRequestSiege                 22           19  -13.64%
BenchmarkReadRequestWrk                   11           11    0.00%

benchmark                          old bytes    new bytes    delta
BenchmarkReadRequestChrome              3148         2216  -29.61%
BenchmarkReadRequestCurl                 905         1413   56.13%
BenchmarkReadRequestApachebench          956         1413   47.80%
BenchmarkReadRequestSiege               1397         1522    8.95%
BenchmarkReadRequestWrk                  757         1369   80.85%

R=bradfitz
CC=golang-dev
https://golang.org/cl/7300098
2013-02-14 19:35:38 +11:00
Robin Eklind
44d38ae3c0 archive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.
FileInfoHeader can now handle fifo, setuid, setgid and sticky bits.

Fixes #4695.

R=golang-dev, donovanhide, r.eklind.87, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7305072
2013-02-14 17:32:48 +11:00
David Symonds
78cee8b3bb sort: use fewer comparisons when choosing pivot.
This is based on rsc's code posted to issue 2585.

Benchmark results are greatly improved:
        benchmark                old ns/op    new ns/op    delta
        BenchmarkSortString1K       564397       445897  -21.00%
        BenchmarkSortInt1K          270889       221249  -18.32%
        BenchmarkSortInt64K       26850765     21351967  -20.48%

Eyeballing a sampling of the raw number of comparisons shows a drop
on the order of 20-30% almost everywhere. The test input data that
doesn't match that are some of sawtooth/rand/plateau distributions,
where there is no change in the number of comparisons; that is,
there are no situations where this makes *more* comparisons.

Fixes #2585.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/7306098
2013-02-14 15:04:22 +11:00
Russ Cox
e5dae3baaa runtime: tweak addfinroots to preserve original pointer
Use local variable so that stack trace will show value of v.

Fixes #4790.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7300106
2013-02-13 22:31:45 -05:00
Brad Fitzpatrick
0c8ed71079 database/sql: fix doc references to old package name
It used to be package "db" but was long ago renamed
to be "sql".

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7322075
2013-02-13 18:47:25 -08:00
Brad Fitzpatrick
cd566958e9 net/http: test that we preserve Go 1.0 Request.Write Host behavior
Fixes #4792

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7314093
2013-02-13 18:33:15 -08:00
Julien Schmidt
2968e239b0 database/sql: Add an optional Queryer-Interface (like Execer)
Completly the same like the Execer-Interface, just for Queries.
This allows Drivers to execute Queries without preparing them first

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7085056
2013-02-13 15:25:39 -08:00
Dave Cheney
8c30b3f038 net: remove noisy test for issue 3590
The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage.

Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships.

R=alex.brainman, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/7307110
2013-02-14 10:11:16 +11:00
Mikio Hara
ee9d148ce1 net: add test for Dial and Listen arguments
R=dave, bradfitz
CC=golang-dev
https://golang.org/cl/7305081
2013-02-14 07:02:32 +09:00
Brad Fitzpatrick
d6331b447f io: document and test new CopyN return behavior
Changed accidentally in 28966b7b2f0c (CopyN using Copy).
Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast)

R=rsc
CC=golang-dev
https://golang.org/cl/7314069
2013-02-13 13:52:00 -08:00
Brad Fitzpatrick
8f2430a533 database/sql: add currently-disabled broken test
Update #3865

R=golang-dev, alex.brainman, nightlyone
CC=golang-dev
https://golang.org/cl/7324051
2013-02-13 12:00:03 -08:00
Robert Griesemer
f6fe3271f7 go/types: adjust gcimporter to actual gc export data
Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

R=adonovan
CC=golang-dev
https://golang.org/cl/7307112
2013-02-13 10:21:24 -08:00
Dmitriy Vyukov
4a524311f4 runtime: instrument slicebytetostring for race detection
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7322068
2013-02-13 18:29:59 +04:00
Christian Himpel
96082a6953 archive/tar: append a slash when deriving header info from a directory
This behavior is identical to GNU tar 1.26.

R=dsymonds, dave
CC=golang-dev
https://golang.org/cl/7307101
2013-02-13 19:23:28 +11:00
Alex Brainman
ea1f7b8380 net: change server_test.go so we could see failure messages
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7323051
2013-02-13 16:17:47 +11:00
Alan Donovan
928fe51661 exp/ssa: add Instruction.Operands and Value.Referrers methods.
Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values.  These will be used for SSA renaming, to follow.

R=iant, gri
CC=golang-dev
https://golang.org/cl/7312090
2013-02-13 00:15:07 -05:00
Robert Griesemer
27970af5c9 go/types: print, println accept 0 or more arguments
R=adonovan
CC=golang-dev
https://golang.org/cl/7304089
2013-02-12 19:40:20 -08:00
Alex Brainman
17377ab651 os: do not use hosts file for windows tests
Not everyone has the file (http://golang.org/issue/4723#c4).

Update #4723.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7311091
2013-02-13 13:19:06 +11:00
Alan Donovan
be5deb93fb exp/ssa: omit Function's package name when printing intra-package references.
R=iant
CC=golang-dev
https://golang.org/cl/7307105
2013-02-12 16:13:14 -05:00
Shenghou Ma
83da2014a8 encoding/xml: fix htmlAutoClose and its generating script
Thanks Mitică for reporting this.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7308081
2013-02-13 02:27:42 +08:00
Shenghou Ma
2fdd60b9b6 go/build, runtime/cgo: cgo support for NetBSD/ARM
R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/7229082
2013-02-13 01:06:52 +08:00
Shenghou Ma
4d8b1feb79 sync/atomic: support NetBSD/ARM (ARM11 or above)
R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/7287044
2013-02-13 01:04:13 +08:00
Shenghou Ma
8311697792 syscall: NetBSD/ARM support
R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/7288050
2013-02-13 01:03:25 +08:00
Shenghou Ma
37aba1aa77 runtime: NetBSD/ARM support
R=rsc, dave
CC=golang-dev
https://golang.org/cl/7289044
2013-02-13 01:00:04 +08:00
Marcel van Lohuizen
f38da96755 exp/locale/collate: moved low-level collation functionality
into separate package.  This allows this code to be shared
with the search package without the need for these two to use
the same tables.
Adjusted various files accordingly.

R=rsc
CC=golang-dev
https://golang.org/cl/7213044
2013-02-12 15:59:55 +01:00
Robert Griesemer
ae8da3a28c go/types: len(((*T)(nil)).X) is const if X is an array
Fixes #4744.

R=adonovan
CC=golang-dev
https://golang.org/cl/7305080
2013-02-11 22:39:55 -08:00
Alan Donovan
d8e3b16f8b exp/ssa: special-case 'range' loops based on type of range expression.
The lowering of ast.RangeStmt now has three distinct cases:

1) rangeIter for maps and strings; approximately:
    it = range x
    for {
      k, v, ok = next it
      if !ok { break }
      ...
    }
   The Range instruction and the interpreter's "iter"
   datatype are now restricted to these types.

2) rangeChan for channels; approximately:
    for {
      k, ok = <-x
      if !ok { break }
      ...
    }

3) rangeIndexed for slices, arrays, and *array; approximately:
    for k, l = 0, len(x); k < l; k++ {
      v = x[k]
      ...
    }

In all cases we now evaluate the side effects of the range expression
exactly once, per comments on http://code.google.com/p/go/issues/detail?id=4644.

However the exact spec wording is still being discussed in
https://golang.org/cl/7307083/.  Further (small)
changes may be required once the dust settles.

R=iant
CC=golang-dev
https://golang.org/cl/7303074
2013-02-11 22:12:56 -05:00
Russ Cox
02e05817ad sync: add caution about where to call (*WaitGroup).Add
Fixes #4762.

R=daniel.morsing, adg
CC=golang-dev
https://golang.org/cl/7308045
2013-02-11 08:05:46 -05:00
Andrew Gerrand
66c96f1abc container/list: add package example
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7306078
2013-02-11 17:59:52 +11:00
Nigel Tao
37d92d251b exp/html, exp/html/atom: delete, as they're moving to the go.net
sub-repo.

The matching change is at https://golang.org/cl/7310063

The rationale was discussed at
https://groups.google.com/d/topic/golang-nuts/Qq5hTQyPuLg/discussion

R=adg, dave
CC=golang-dev
https://golang.org/cl/7317043
2013-02-11 11:56:49 +11:00
Volker Dobler
de69401b75 exp/cookiejar: implementation of SetCookies
This CL provides the rest of the SetCookies code as well as
some test infrastructure which will be used to test also
the Cookies method. This test infrastructure is optimized
for readability and tries to make it easy to review table
driven test cases.

Tests for all the different corner cases of SetCookies
will be provided in a separate CL.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7306054
2013-02-11 11:47:31 +11:00
Shane Hansen
1068279904 archive/tar: read/write extended pax/gnu tar archives
Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.

Fixes #3300

R=dsymonds, dave, rogpeppe, remyoudompheng, chressie, rsc
CC=golang-dev
https://golang.org/cl/6700047
2013-02-11 11:36:29 +11:00
Dave Cheney
6ce3e99af0 net/http: more request benchmarks
Add benchmarks for common http benchmarking tools. The intent is to catch optimisations which favor synthetic benchmarks that do not show improvements for real clients like Chrome.

BenchmarkReadRequestChrome        200000             10133 ns/op          60.29 MB/s        3148 B/op         32 allocs/op
BenchmarkReadRequestCurl          500000              4314 ns/op          18.08 MB/s         905 B/op         15 allocs/op
BenchmarkReadRequestApachebench   500000              4363 ns/op          18.79 MB/s         956 B/op         16 allocs/op
BenchmarkReadRequestSiege         500000              6408 ns/op          24.19 MB/s        1397 B/op         22 allocs/op
BenchmarkReadRequestWrk          1000000              2838 ns/op          14.09 MB/s         757 B/op         11 allocs/op

R=golang-dev, bradfitz
CC=golang-dev, haimuiba
https://golang.org/cl/7300075
2013-02-10 08:18:09 +11:00
Adam Langley
e0791a3adf crypto/x509: disable SCG test with system validation.
On Windows, CryptoAPI is finding an alternative validation path. Since
this is a little non-deterministic, this change disables that test
when using system validation.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7313068
2013-02-09 13:51:39 -05:00
Russ Cox
6600092527 testing: be explicit about use of b.N
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7314071
2013-02-09 13:43:15 -05:00
Adam Langley
e1c309e792 crypto/x509: allow MS/NS SCG key usage as ServerAuth.
By default, crypto/x509 assumes that users wish to validate
certificates for ServerAuth. However, due to historical reasons,
COMODO's intermediates don't specify ServerAuth as an allowed key
usage.

Rather NSS and CryptoAPI both allow these SGC OIDs to be equivalent to
ServerAuth.

R=rsc
CC=golang-dev
https://golang.org/cl/7312070
2013-02-09 13:20:25 -05:00
Shenghou Ma
691e5e3b01 bytes: annotate assembly functions with //go:noescape
R=golang-dev, agl, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7299064
2013-02-10 00:08:30 +08:00
Shenghou Ma
705b4544d6 log/syslog: remove socket files after tests
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7305065
2013-02-09 08:19:09 +08:00
Mikio Hara
a0430dae04 net: fix unixgram
The socket for AF_UNIX domain with SOCK_DGARM type isn't
allowed to work with syscall listen.

R=rsc
CC=golang-dev
https://golang.org/cl/7310068
2013-02-09 08:18:32 +09:00
Jan Ziak
1e01fba2fc runtime: precise garbage collection of hashmaps
R=golang-dev, rsc
CC=dave, dvyukov, golang-dev, minux.ma, remyoudompheng
https://golang.org/cl/7252047
2013-02-08 16:00:33 -05:00
Dave Cheney
cccc96b8e9 net/http: add BenchmarkReadRequest
Add benchmark for request parsing. Fixture data is taken from https://github.com/felixge/node-http-perf

% go version
go version devel +28966b7b2f0c Thu Feb 07 20:26:12 2013 -0800 linux/amd64

% go test -run=nil -bench=ReadRequest -benchtime=10s
PASS
BenchmarkReadRequest     2000000   9900 ns/op   61.71 MB/s   3148 B/op   32 allocs/op
ok      net/http        12.180s

R=golang-dev, bradfitz, minux.ma, haimuiba
CC=golang-dev
https://golang.org/cl/7313048
2013-02-09 07:04:07 +11:00
Péter Surányi
d2252d9b07 syscall: check for invalid characters in Setenv on Unix
On POSIX, '=' in key is explicitly invalid, and '\x00' in key/value is implicitly invalid.

R=golang-dev, iant, bradfitz
CC=golang-dev
https://golang.org/cl/7311061
2013-02-08 10:45:46 -08:00
Kamil Kisiel
f26fc0c017 net/http/httptest: add examples
R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/7314046
2013-02-08 09:20:05 -08:00
Alan Donovan
5fa6721a31 exp/ssa/interp: fix MS Windows breakage.
syscall.{Kill,Write} are not portable to MS Windows, so we
disable them for now.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/7312066
2013-02-08 11:58:24 -05:00
Alan Donovan
c8f2449ea7 exp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.
R=gri, iant
CC=golang-dev
https://golang.org/cl/7226065
2013-02-08 10:43:53 -05:00
Dmitriy Vyukov
0a9f1ab8bb runtime/race: deflake tests
With the new scheduler races in the tests are reported during execution of other tests.
The change joins goroutines started during the tests.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7310066
2013-02-08 19:24:50 +04:00
Dmitriy Vyukov
45636db01b runtime: fix integer overflow
The problem happens when end=0, then end-1 is very big number.
Observed with the new scheduler.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7307073
2013-02-08 19:05:19 +04:00
Mikio Hara
6dfd386005 net: simplify Dial, Listen, ListenPacket and those helpers
R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7300065
2013-02-08 21:53:10 +09:00
Mikio Hara
dc6e51cfd2 net: delete duplicate listenerSockaddr
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7299067
2013-02-08 17:02:08 +09:00
Shenghou Ma
6c54bf9916 runtime: fix build for Linux/ARM
R=dave, rsc
CC=golang-dev
https://golang.org/cl/7299055
2013-02-08 13:24:38 +08:00
Jeremy Schlatter
c94eddd1af io: Simplify CopyN implementation by delegating to Copy.
R=golang-dev, dave, minux.ma, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7312055
2013-02-07 20:26:12 -08:00
Russ Cox
18441e8ade net: do not use RLock around Accept
It might be non-blocking, but it also might be blocking.
Cannot take the chance, as Accept might block indefinitely
and make it impossible to acquire ForkLock exclusively
(during fork+exec).

Fixes #4737.

R=golang-dev, dave, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7309050
2013-02-07 22:45:12 -05:00
Brad Fitzpatrick
30a9957aac bytes: minor optimization to lastIndexFunc
Before and after:
BenchmarkTrimSpace  20000000   81.3 ns/op
BenchmarkTrimSpace  50000000   58.0 ns/op

(most whitespace trimming is ASCII whitespace)

Same optimization appeared a handful of other places
in this file, but not here.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7305063
2013-02-07 16:00:06 -08:00
Ian Lance Taylor
2b44c33b4a crypto/md5: fix for big-endian processors
R=golang-dev, minux.ma, agl
CC=golang-dev
https://golang.org/cl/7305059
2013-02-07 13:31:53 -08:00
Ian Lance Taylor
514f10b9ab net: skip TestMulticastListener on Solaris
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7308060
2013-02-07 09:58:42 -08:00
Péter Surányi
fe7dbea00e os/exec: LookPath on Unix shouldn't look in cwd when PATH is empty
R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7305053
2013-02-07 06:41:35 -08:00
Shenghou Ma
80e1cf73eb crypto/rc4: naïve ARM assembly implementation
On 800MHz Cortex-A8:
benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         9395         2838  -69.79%
BenchmarkRC4_1K         74497        22120  -70.31%
BenchmarkRC4_8K        587243       171435  -70.81%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        13.62        45.09    3.31x
BenchmarkRC4_1K         13.75        46.29    3.37x
BenchmarkRC4_8K         13.79        47.22    3.42x

Result for "OpenSSL 1.0.1c 10 May 2012" from Debian/armhf sid:
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
rc4              39553.81k    46522.39k    49336.11k    50085.63k    50258.06k

R=golang-dev, agl, dave
CC=golang-dev
https://golang.org/cl/7310051
2013-02-07 18:54:21 +08:00
Ian Lance Taylor
0592c44956 net: permit pollster DelFD to return whether to call Wakeup
This is necessary for systems that use select as the pollster,
such as Solaris (supported by gccgo).  It corresponds to the
bool returned by AddFD.  In general it's not clearly defined
what happens when a descriptor used in a select is closed, and
different systems behave differently.  Waking up the select
will cause the right thing to happen: the closed descriptor
will be dropped from the next iteration.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7303056
2013-02-06 17:18:53 -08:00
Gaal Yahas
c2fb6e2c0b sync: improve WaitGroup example by putting the call to Done in a
deferred block. This makes hangs in the waiting code less likely
if a goroutine exits abnormally.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7306052
2013-02-07 00:39:52 +08:00
Albert Strasheim
309d88e28c syscall, net: Fix unix socket autobind on Linux.
R=rsc, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7300047
2013-02-06 06:45:57 -08:00
Volker Dobler
8c6489bc27 exp/cookiejar: infrastructure for upcoming implementation
This CL is the first of a handful of CLs which will provide
the implementation of cookiejar. It contains several helper
functions and the skeleton of Cookies and SetCookies.

Proper host name handling requires the ToASCII transformation
from package idna which currently lives in the go.net
subrepo. This CL thus contains just a TODO for this issue.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7287046
2013-02-06 22:37:34 +11:00
Dmitriy Vyukov
0a40cd2661 runtime/race: switch to explicit race context instead of goroutine id's
Removes limit on maximum number of goroutines ever existed.
code.google.com/p/goexecutor tests now pass successfully.
Also slightly improves performance.
Before: $ time ./flate.test -test.short
real	0m9.314s
After:  $ time ./flate.test -test.short
real	0m8.958s
Fixes #4286.
The runtime is built from llvm rev 174312.

R=rsc
CC=golang-dev
https://golang.org/cl/7218044
2013-02-06 11:40:54 +04:00
Jeff R. Allen
33995fe59e log/syslog: retry once if write fails
Implements deferred connections + single-attempt automatic
retry. Based on CL 5078042 from kuroneko.

Fixes #2264.

R=mikioh.mikioh, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6782140
2013-02-05 09:54:01 -08:00
Shenghou Ma
7de3d71797 runtime: save LR to stack when panicking to handle leaf function traceback
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7289047
2013-02-06 01:18:37 +08:00
Ian Lance Taylor
da35d42521 exp/inotify: close event channel before file descriptor
Closing the inotify file descriptor can take over a second
when running on Ubuntu Precise in an NFS directory, leading to
the test error in issue 3132.  Closing the event channel first
lets a client that does not care about the error channel move
on.

Fixes #3132.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7300045
2013-02-05 06:11:10 -08:00
Caleb Spare
dff017ea99 container/heap: fix comment typo in example test
This updates a bad reference to a method name in the example priority queue test.

The error was introduced in the example refactoring in rev. 2ea8f07b2ffe.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7279045
2013-02-05 07:06:00 -05:00
Dmitriy Vyukov
6b1b613d6a runtime/race: do not include pthread.h
Fixes #4721.

R=alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/7275048
2013-02-05 13:08:07 +04:00
David Symonds
e7fe1944ac archive/tar: small simplification using FileMode.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7305043
2013-02-05 15:39:55 +11:00
Brad Fitzpatrick
d1e16d06b4 net/http: fix Server blocking after a Handler's Write fails
If a Handle's Write to a ResponseWriter fails (e.g. via a
net.Conn WriteDeadline via WriteTimeout on the Server), the
Server was blocking forever waiting for reads on that
net.Conn, even after a Write failed.

Instead, once we see a Write fail, close the connection,
since it's then dead to us anyway.

Fixes #4741

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7301043
2013-02-04 20:26:25 -08:00
Russ Cox
a60ffed9e7 path/filepath: document that Walk does not follow symlinks
Fixes #4759.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7304043
2013-02-04 22:59:30 -05:00
Anthony Martin
c56bb1d238 syscall: fix marshaling of stat messages on Plan 9
The order of the Qid fields was reversed. Mea culpa.

R=seed
CC=golang-dev
https://golang.org/cl/7231062
2013-02-04 19:47:23 -08:00
Brad Fitzpatrick
92e4645f31 net/http: add Next Protocol Negotation upgrade support to the Server
This provides the mechanism to connect SPDY support to the http
package, without pulling SPDY into the standard library.

R=rsc, agl, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7287045
2013-02-04 13:55:38 -08:00
Mikio Hara
5ae6a23731 syscall: regenerate ztype files for linux
This CL adds TCPInfo struct to linux/386,arm.
It's already added to linux/amd64.

Note that not sure the reason but cgo godefs w/ latest gcc
translates a flexible array member in structures correctly,
handles it as a non-incomplete, non-opaque type, on Go 1.
This CL reverts such changes by hand for the Go 1 contract.

R=minux.ma, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7197046
2013-02-05 06:53:58 +09:00
Brad Fitzpatrick
022504b3ab net/http: fix when server deadlines get extended
Deadlines should be extended at the beginning of
a request, not at the beginning of a connection.

Fixes #4676

R=golang-dev, fullung, patrick.allen.higgins, adg
CC=golang-dev
https://golang.org/cl/7220076
2013-02-04 13:52:45 -08:00
Alan Donovan
c06a5335ba exp/ssa: (#4 of 5): the SSA builder.
R=iant, gri, iant, rogpeppe
CC=golang-dev
https://golang.org/cl/7196053
2013-02-04 12:22:35 -05:00
Alex Brainman
94064548c6 net: use windows sysSocket everywhere
R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7273046
2013-02-04 16:03:41 +11:00
Russ Cox
472354f81e runtime/debug: add controls for garbage collector
Fixes #4090.

R=golang-dev, iant, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/7229070
2013-02-04 00:00:55 -05:00
Russ Cox
6b4cf2b367 time: fix error message from Parse
Was incorrectly discarding the offending text in some cases.

Fixes #4493.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7277050
2013-02-04 00:00:36 -05:00
Andrew Gerrand
5fad786452 regexp: update comment on (*Regexp).Longest
Missed this review comment.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7229084
2013-02-04 15:57:32 +11:00
Russ Cox
89a2a8c8df cmd/go, testing: revise docs for test flags
In cmd/go's 'go help testflag':
* Rewrite list of flags to drop test. prefix on every name.
* Sort list of flags.
* Add example of using -bench to match all benchmarks.

In testing:
* Remove mention of undefined 'CPU group' concept.

Fixes #4488.
Fixes #4508.

R=adg
CC=golang-dev
https://golang.org/cl/7288053
2013-02-03 23:47:03 -05:00
Nigel Tao
4e285bac6e container/heap: fix package doc comment about ordering.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/7280044
2013-02-04 15:30:41 +11:00
Andrew Gerrand
f41ffc2bf4 regexp: add (*Regexp).Longest
Fixes #3696.

R=rsc
CC=golang-dev
https://golang.org/cl/7133051
2013-02-04 15:28:55 +11:00
Russ Cox
1d9f67daf0 time: deal a bit better with time zones in Parse
* Document Parse's zone interpretation.
* Add ParseInLocation (API change).
* Recognize "wrong" time zone names, like daylight savings time in winter.
* Disambiguate time zone names using offset (like winter EST vs summer EST in Sydney).

The final two are backwards-incompatible changes, but I believe
they are both buggy behavior in the Go 1.0 versions; the old results
were more wrong than the new ones.

Fixes #3604.
Fixes #3653.
Fixes #4001.

R=adg
CC=golang-dev
https://golang.org/cl/7288052
2013-02-03 23:02:12 -05:00
Russ Cox
6a003d7589 time: handle zone file with no transitions
Code fix by Alex Bramley.

Fixes #4064.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7289049
2013-02-03 22:41:00 -05:00
Andrew Gerrand
0df8c7517e archive/tar: add Copyright notice to example_test.go
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7278050
2013-02-04 14:34:35 +11:00
Alex Brainman
bc9999337b net: prevent races during windows lookup calls
This only affects code (with exception of lookupProtocol)
that is only executed on older versions of Windows.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7293043
2013-02-04 13:05:20 +11:00
Robin Eklind
97916f1154 archive/tar: Add reader and writer code example.
Remove the previous comment examples.

R=golang-dev, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7220048
2013-02-04 12:37:18 +11:00
Russ Cox
f02067a99a cmd/gc: implement latest rules for checking make sizes
Fixes #4085.

R=ken2
CC=golang-dev
https://golang.org/cl/7277047
2013-02-03 14:28:44 -05:00
Shivakumar GN
848d10f06c xml: omit newline at beginning of MarshalIndent output
(Still valid XML.)

Fixes #3354.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7288047
2013-02-03 11:21:07 -05:00
Russ Cox
e87cc3dc5b exp/gotype: disable broken test
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7275045
2013-02-03 01:25:58 -05:00
Russ Cox
2eafbb8878 cmd/gc: elide self-assignment during return
More efficient, less racy code.

Fixes #4014.

R=ken2, ken
CC=golang-dev
https://golang.org/cl/7275047
2013-02-03 01:18:28 -05:00
Kyle Lemons
9bfd3c3937 testing: add AllocsPerRun
This CL also replaces similar loops in other stdlib
package tests with calls to AllocsPerRun.

Fixes #4461.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7002055
2013-02-02 22:52:29 -05:00
Russ Cox
18178fd138 cmd/go: run examples in source order, not name order
Add Order field to doc.Example and write doc comments there.

Fixes #4662.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7229071
2013-02-02 16:26:12 -05:00
Ian Lance Taylor
e5ea2d5335 runtime: fix windows build
Fixes #4743.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7284044
2013-02-02 11:41:04 -08:00
Shenghou Ma
dcf16bd83d syscall: (*Proc).Call should return nil error when no error occurs
Fixes #4686.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/7174047
2013-02-03 01:42:17 +08:00
Russ Cox
b396d1143b reflect: explain StructField.Anonymous field as 'embedded'
The spec mostly uses the term embedded.
It's too late to change the field name but at least fix the docs.

Fixes #4514.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7235080
2013-02-01 21:01:46 -05:00
Russ Cox
2cb8dcea5c testing: SkipNow, FailNow must be called from test goroutine
Impossible for us to check (without sleazily reaching into the
runtime) but at least document it.

Fixes #3800.

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7268043
2013-02-01 21:01:32 -05:00
Alex Brainman
6d175e243a net: use windows GetAddrInfoW in LookupPort when possible
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7252045
2013-01-18 17:05:04 +11:00
Elias Naur
44cf814d50 runtime, cmd/ld: make code more position-independent
Change the stack unwinding code to compensate for the dynamic
relocation of symbols.
Change the gc instruction GC_CALL to use a relative offset instead of
an absolute address.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7248048
2013-02-01 11:24:49 -08:00
Robert Daniel Kortschak
11d16dc535 reflect: document that Value.Slice panics on an unaddressable array.
Fixes #4736.

R=rsc
CC=golang-dev
https://golang.org/cl/7239045
2013-02-01 10:02:23 -08:00
Brad Fitzpatrick
2ccd4e9f87 sort: delete now-duplicate example, fix build
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7220075
2013-02-01 09:08:25 -08:00
Miek Gieben
d4cfe28885 sort: add Reverse as a function
This updates: https://golang.org/cl/6909059/
Fixes #4511.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6932054
2013-02-01 08:44:45 -08:00
Brad Fitzpatrick
e515d80d5d bytes, strings: add TrimPrefix and TrimSuffix
Everybody either gets confused and thinks this is
TrimLeft/TrimRight or does this by hand which gets
repetitive looking.

R=rsc, kevlar
CC=golang-dev
https://golang.org/cl/7239044
2013-02-01 08:41:25 -08:00
Russ Cox
b0a29f393b runtime: cgo-related fixes
* Separate internal and external LockOSThread, for cgo safety.
* Show goroutine that made faulting cgo call.
* Never start a panic due to a signal caused by a cgo call.

Fixes #3774.
Fixes #3775.
Fixes #3797.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7228081
2013-02-01 08:34:41 -08:00
Volker Dobler
7d8cc587b2 exp/cookiejar: remove external storage
This CL removes the external storage of a cookie jar
and minimized the exported API as discussed in [1].

[1] https://groups.google.com/d/topic/golang-dev/ygDB3nbir00/discussion

Update #1960.

R=nigeltao
CC=golang-dev
https://golang.org/cl/7235065
2013-02-01 10:56:08 +11:00
Russ Cox
31fafa5081 encoding/base64: fix test for ReadFull change
R=golang-dev
CC=golang-dev
https://golang.org/cl/7249045
2013-01-31 14:42:56 -08:00
Russ Cox
662ff54212 io: guarantee err == nil for full reads in ReadFull and ReadAtLeast
This is a backwards compatible API change that fixes broken code.

In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or len(buf), non-nil.
Most code expects only the former, so do that and document the guarantee.

Code that was correct before is still correct.
Code that was incorrect before, by assuming the guarantee, is now correct too.

The same applies to ReadAtLeast.

Fixes #4544.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7235074
2013-01-31 13:46:12 -08:00
Russ Cox
4085426f7d net/url: normalize scheme to lower case (http not HTTP)
Also document %2f vs / ambiguity in URL.Path.

Fixes #3913.
Fixes #3659.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7225076
2013-01-31 13:45:43 -08:00
Adam Langley
5c659d7362 crypto/x509: test for negative RSA parameters.
Someone found software that generates negative numbers for the RSA
modulus in an X.509 certificate. Our error messages were very poor in
this case so this change improves that.

Update #4728
Return more helpful errors when RSA parameters are negative or zero.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7228072
2013-01-31 12:54:37 -05:00
Russ Cox
8b6534b78a cmd/go: many bug fixes
* Reject import paths of the form cmd/x/y.
* Reject 'go install' of command outside GOPATH
* Clearer error rejecting 'go install' of package outside GOPATH.
* Name temporary binary for first file in 'go run' list or for test.
* Provide a way to pass -ldflags arguments with spaces.
* Pass all Go files (even +build ignored ones) to go fix, go fmt, go vet.
* Reject 'go run foo_test.go'.
* Silence 'exit 1' prints from 'go tool' invocations.
* Make go test -xxxprofile leave binary behind for analysis.
* Reject ~ in GOPATH except on Windows.
* Get a little less confused by symlinks.
* Document that go test x y z runs three test binaries.
* Fix go test -timeout=0.
* Add -tags flag to 'go list'.
* Use pkg/gccgo_$GOOS_$GOARCH for gccgo output.

Fixes #3389.
Fixes #3500.
Fixes #3503.
Fixes #3760.
Fixes #3941.
Fixes #4007.
Fixes #4032.
Fixes #4074.
Fixes #4127.
Fixes #4140.
Fixes #4311.
Fixes #4568.
Fixes #4576.
Fixes #4702.

R=adg
CC=golang-dev
https://golang.org/cl/7225074
2013-01-31 08:06:38 -08:00
Russ Cox
30985c1203 os: use signal strings where possible in ProcessState.String
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7228067
2013-01-31 07:53:18 -08:00
Russ Cox
956cd0059c encoding/json: document case-insensitive Unmarshal key matching
Fixes #4664.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7237060
2013-01-31 07:49:23 -08:00
Caleb Spare
0e74f04acc container/heap: split example into two
This adds a simple IntHeap example, and modifies the more complex
PriorityQueue example to make use of the index field it maintains.

Fixes #4331.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/7068048
2013-01-30 23:14:29 -08:00
Alex Brainman
bd75468a08 os: provide access to file LastAccessTime and CreationTime on windows
Fixes #4569.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6972047
2013-01-31 17:17:37 +11:00
Nigel Tao
6799b773eb exp/cookiejar: update PublicSuffixList doc comment to match the
examples at http://publicsuffix.org/.

That website previously listed pvt.k12.wy.us, but that was an error,
as confirmed by correspondance with submissions@publicsuffix.org, and
the website was fixed on 2013-01-23.

R=adg
CC=dr.volker.dobler, golang-dev
https://golang.org/cl/7241053
2013-01-31 14:12:43 +11:00
Robert Daniel Kortschak
92bc896909 fmt: improve go syntax handling of byte-derived arrays and slices
Fixes #4685.

R=golang-dev, adg, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/7205047
2013-01-30 17:53:53 -08:00
Rick Arnold
eea0f19990 encoding/json: improve performance of Unmarshal on primitive types
Attempt 2. The first fix was much faster but ignored syntax errors.

benchmark                      old ns/op    new ns/op    delta
BenchmarkCodeEncoder            74993543     72982390   -2.68%
BenchmarkCodeMarshal            77811181     75610637   -2.83%
BenchmarkCodeDecoder           213337123    190144982  -10.87%
BenchmarkCodeUnmarshal         212180972    190394852  -10.27%
BenchmarkCodeUnmarshalReuse    202113428    182106660   -9.90%
BenchmarkUnmarshalString            1343          919  -31.57%
BenchmarkUnmarshalFloat64           1149          908  -20.97%
BenchmarkUnmarshalInt64              967          778  -19.54%
BenchmarkSkipValue              28851581     28414125   -1.52%

benchmark                       old MB/s     new MB/s  speedup
BenchmarkCodeEncoder               25.88        26.59    1.03x
BenchmarkCodeMarshal               24.94        25.66    1.03x
BenchmarkCodeDecoder                9.10        10.21    1.12x
BenchmarkCodeUnmarshal              9.15        10.19    1.11x
BenchmarkSkipValue                 69.05        70.11    1.02x

Fixes #3949.

R=rsc
CC=golang-dev
https://golang.org/cl/7231058
2013-01-30 17:53:48 -08:00
Alan Donovan
19bb42d637 math/big: make tests faster by reducing coverage in --test.short mode.
The time to test all of math/big is now:
 default      => ~3min
 --test.short => 150ms

R=rsc
CC=golang-dev
https://golang.org/cl/7223054
2013-01-30 18:19:58 -05:00
Brad Fitzpatrick
1aa56a2396 net/http: fix race
Fixes #4724

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7225071
2013-01-30 15:10:07 -08:00
Russ Cox
fa2acad603 crypto/cipher: avoid out of bounds error in CryptBlocks
Fixes #4699.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/7231065
2013-01-30 12:45:13 -08:00
Marcel van Lohuizen
f5154edc53 exp/locale/collate/tools/colcmp: fixes some discrepancies between
ICU and collate package: ICU requires strings to be in FCD form.
Not all NFC strings are in this form, leading to incorrect results.
Change to NFD instead.

R=rsc
CC=golang-dev
https://golang.org/cl/7201043
2013-01-30 21:19:03 +01:00
Jeff R. Allen
6563d8623d syscall: handle empty address in ReadFrom better
Handle return values from recvfrom correctly when the
kernel decides to not return an address.

Fixes #4636.
Fixes #4352.

R=rsc, mikioh.mikioh, dave
CC=golang-dev
https://golang.org/cl/7058062
2013-01-30 10:02:01 -08:00
Akshat Kumar
fb451490ec os: don't hold ForkLock across opens on Plan 9
If os.OpenFile holds ForkLock on files that block opens,
then threads that simultaneously try to do fork-exec will
get hung up (until the open succeeds). Blocked opens are
common enough on Plan 9 that protecting against fd leaks
into fork-execs means not being able to do fork-execs
properly in the general case. Thus, we forgo taking the
lock.

R=rsc, ality
CC=golang-dev
https://golang.org/cl/7235066
2013-01-30 09:41:16 -08:00
Michael Teichgräber
ad341843a7 net: SplitHostPort: adjust error message for missing port in IPv6 addresses
An hostport of "[::1]" now results in the same error message
"missing port in address" as the hostport value "127.0.0.1",
so SplitHostPort won't complain about "too many colons
in address" anymore for an IPv6 address missing a port.

Added tests checking the error values.

Fixes #4526.

R=dave, rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7038045
2013-01-30 09:25:16 -08:00
Andrey Mirtchovski
e579395905 encoding/json: properly unmarshal empty arrays.
The JSON unmarshaller failed to allocate an array when there
are no values for the input causing the `[]` unmarshalled
to []interface{} to generate []interface{}(nil) rather than
[]interface{}{}. This wasn't caught in the tests because Decode()
works correctly and because jsonBig never generated zero-sized
arrays. The modification to scanner_test.go quickly triggers
the error:

without the change to decoder.go, but with the change to scanner_test.go:

$ go test
--- FAIL: TestUnmarshalMarshal (0.10 seconds)
decode_test.go:446:		Marshal jsonBig
scanner_test.go:206:	diverge at 70: «03c1OL6$":null},{"[=» vs «03c1OL6$":[]},{"[=^\»
FAIL
exit status 1
FAIL	encoding/json	0.266s

Also added a simple regression to decode_test.go.

R=adg, dave, rsc
CC=golang-dev
https://golang.org/cl/7196050
2013-01-30 09:10:32 -08:00
Jan Ziak
4da6b36fbf runtime: local allocation in mprof.goc
Binary data in mprof.goc may prevent the garbage collector from freeing
memory blocks. This patch replaces all calls to runtime·mallocgc() with
calls to an allocator private to mprof.goc, thus making the private
memory invisible to the garbage collector. The addrhash variable is
moved outside of the .bss section.

R=golang-dev, dvyukov, rsc, minux.ma
CC=dave, golang-dev, remyoudompheng
https://golang.org/cl/7135063
2013-01-30 09:01:31 -08:00
Adam Langley
475d86b6d9 crypto/rc4: add simple amd64 asm implementation.
(Although it's still half the speed of OpenSSL.)

benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         1409          398  -71.75%
BenchmarkRC4_1K         10920         2898  -73.46%
BenchmarkRC4_8K        131323        23083  -82.42%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        90.83       321.43    3.54x
BenchmarkRC4_1K         93.77       353.28    3.77x
BenchmarkRC4_8K         61.65       350.73    5.69x

R=rsc, remyoudompheng
CC=golang-dev, jgrahamc
https://golang.org/cl/7234055
2013-01-30 11:01:19 -05:00
Russ Cox
ee90874826 encoding/xml: add (*Encoder).Indent
Exposing this on the Encoder allows streaming generation of indented XML.

R=golang-dev, rogpeppe
CC=golang-dev
https://golang.org/cl/7221075
2013-01-30 07:57:20 -08:00
Akshat Kumar
c74f3c4576 runtime: add support for panic/recover in Plan 9 note handler
This change also resolves some issues with note handling: we now make
sure that there is enough room at the bottom of every goroutine to
execute the note handler, and the `exitstatus' is no longer a global
entity, which resolves some race conditions.

R=rminnich, npe, rsc, ality
CC=golang-dev
https://golang.org/cl/6569068
2013-01-30 02:53:56 -08:00
Rémy Oudompheng
ccc61eadd5 runtime: implement range access functions in race detector.
Range access functions are already available in TSan library
but were not yet used.

Time for go test -race -short:

Before:
compress/flate 24.244s
exp/norm       >200s
go/printer     78.268s

After:
compress/flate 17.760s
exp/norm        5.537s
go/printer      5.738s

Fixes #4250.

R=dvyukov, golang-dev, fullung
CC=golang-dev
https://golang.org/cl/7229044
2013-01-30 01:55:02 +01:00
Andrew Gerrand
3bf3ba2d81 go/build: clean up after rollback
R=rsc
CC=golang-dev
https://golang.org/cl/7237049
2013-01-30 09:10:58 +11:00
Russ Cox
ad37081b67 encoding/json: add test for Unmarshal of malformed data
Roll back CL making primitive type unmarshal faster,
because it broke the Unmarshal of malformed data.

Add benchmarks for unmarshal of primitive types.

Update #3949.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7228061
2013-01-29 13:34:18 -08:00
Russ Cox
ec1948a44d runtime: clear up lr comments
R=cshapiro
CC=golang-dev
https://golang.org/cl/7230052
2013-01-29 13:12:50 -08:00
Alan Donovan
aa0b573ad6 exp/ssa: make Parameters values, not addresses.
We explicitly spill all parameters to the frame during initial
SSA construction.  (Later passes will remove spills.)
We now properly handle local Allocs escaping via Captures.

Also: allocate BasicBlock.Succs inline.

R=iant, iant
CC=golang-dev
https://golang.org/cl/7231050
2013-01-29 10:49:16 -05:00
Dmitriy Vyukov
81221f512d runtime: dump the full stack of a throwing goroutine
Useful for debugging of runtime bugs.
+ Do not print "stack segment boundary" unless GOTRACEBACK>1.
+ Do not traceback system goroutines unless GOTRACEBACK>1.

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/7098050
2013-01-29 14:57:11 +04:00
Brad Fitzpatrick
91e99c1345 encoding/json: add Decoder.Buffered accessor to get overread data
Otherwise it's impossible to know how much data from the
json.Decoder's underlying Reader was actually consumed.

The old fix from golang.org/issue/1955 just added docs. This
provides an actual mechanism.

Update #1955

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/7181053
2013-01-28 16:31:46 -08:00