]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogo/build: evaluate symlinks before comparing path to GOPATH
Andrew Gerrand [Mon, 4 Jul 2011 00:26:03 +0000 (10:26 +1000)]
go/build: evaluate symlinks before comparing path to GOPATH

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

13 years agogodoc: search GOPATH for documentation
Andrew Gerrand [Sat, 2 Jul 2011 04:07:06 +0000 (14:07 +1000)]
godoc: search GOPATH for documentation

R=rsc, mattn.jp
CC=golang-dev
https://golang.org/cl/4627065

13 years agogoinstall: documentation for new remote repository behavior and tweaks
Andrew Gerrand [Sat, 2 Jul 2011 04:05:43 +0000 (14:05 +1000)]
goinstall: documentation for new remote repository behavior and tweaks

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

13 years agodashboard: show build state and package comments on dashboard
Andrew Gerrand [Sat, 2 Jul 2011 04:02:42 +0000 (14:02 +1000)]
dashboard: show build state and package comments on dashboard

This permits full URLs to be shown on the dashboard,
not just the repository roots.

This has been tested.

R=rsc, mattn.jp
CC=golang-dev
https://golang.org/cl/4627081

13 years agocrypto/openpgp: add ability to reserialize keys.
Adam Langley [Fri, 1 Jul 2011 17:53:12 +0000 (13:53 -0400)]
crypto/openpgp: add ability to reserialize keys.

This changes Signature so that parsed signatures can be reserialized
exactly. With this ability we can add Serialize to Entity and also the
ability to sign other public keys.

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

13 years agocsv: new package
Paul Borman [Fri, 1 Jul 2011 16:16:56 +0000 (12:16 -0400)]
csv: new package

csv reader/writer based on RFC 4180

R=rsc, mattn.jp, r, dchest
CC=golang-dev
https://golang.org/cl/4629085

13 years agoCONTRIBUTORS: add Paul Borman (Google CLA)
Russ Cox [Fri, 1 Jul 2011 16:09:53 +0000 (12:09 -0400)]
CONTRIBUTORS: add Paul Borman (Google CLA)

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

13 years ago5c, 6c: fix build
Russ Cox [Fri, 1 Jul 2011 15:13:38 +0000 (11:13 -0400)]
5c, 6c: fix build

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

13 years agolib9: stop build if ../version.bash fails
Alex Brainman [Fri, 1 Jul 2011 14:42:25 +0000 (10:42 -0400)]
lib9: stop build if ../version.bash fails

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

13 years agowindows: define and use syscall.Handle
Wei Guangjing [Fri, 1 Jul 2011 14:18:07 +0000 (10:18 -0400)]
windows: define and use syscall.Handle
Fixes #1487.

R=rsc, alex.brainman, go.peter.90, mikioh.mikioh, mattn.jp
CC=golang-dev
https://golang.org/cl/4600042

13 years agocmd/goinstall: try to access via https.
Yasuhiro Matsumoto [Fri, 1 Jul 2011 14:11:33 +0000 (10:11 -0400)]
cmd/goinstall: try to access via https.

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

13 years ago8c: fixes for Plan 9 build
Lucio De Re [Fri, 1 Jul 2011 13:50:24 +0000 (09:50 -0400)]
8c: fixes for Plan 9 build

8c/gc.h:
. Added <u.h> header.
. Added "lD" pragma for "*Adr" to supplement "D".

8c/swt.c:
. Removed unreferenced "thestring" arguments in Bprint() calls.

cc/acid.c:
cc/com.c:
cc/com64.c:
cc/dcl.c:
cc/scon.c:
. Added <u.h>, required by "cc.h".

cc/bits.c:
. Added <u.h>, required by "cc.h".

cc/cc.h:
. Removed <u.h> and <ctype.h>.
. Added "O" pragma to accept "uint" as well as "int".
. Added new "U" pragma (char *).

cc/cc.y:
. Added <u.h> before <stdio.h> (and "cc.h").

cc/dpchk.c:
cc/mac.c:
. Added <u.h> and <ctype.h>.

cc/funct.c:
. Added <u.h>, required by "cc.h".

cc/godefs.c
. Added <u.h>, required by "cc.h".
. Dropped unused "t" argument in Bprint().

cc/lex.c:
. Added <u.h> and <ctype.h>.
. Removed unnecessary incrementation.
. Changed exit() invocations with exits().

cc/omachcap.c:
. Added <u.h>, required by "cc.h".
. USED(n) for unused argument to machcap().

cc/sub.c:
. Added <u.h> and <ctype.h>.

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

13 years agofix build; add simplify.go to regexp Makefile
Brad Fitzpatrick [Thu, 30 Jun 2011 17:45:36 +0000 (10:45 -0700)]
fix build; add simplify.go to regexp Makefile

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

13 years agohttp/cgi: add Handler.Dir to specify working directory
Yasuhiro Matsumoto [Thu, 30 Jun 2011 16:44:23 +0000 (09:44 -0700)]
http/cgi: add Handler.Dir to specify working directory

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

13 years agosync: improve Mutex to allow successive acquisitions
Dmitriy Vyukov [Thu, 30 Jun 2011 15:13:29 +0000 (11:13 -0400)]
sync: improve Mutex to allow successive acquisitions
This implementation allows a goroutine to do successive acquisitions
of a mutex even if there are blocked goroutines.
Moreover, it allows a newcomer goroutine to acquire a mutex ahead of
blocked goroutines (that is, it does not enforce FIFO).
On implementation level it's achieved by separating waiter count and
locked flag.
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows (with 4631059 "replace Semacquire/Semrelease implementation"
patch applied):
benchmark                                        old ns/op    new ns/op    delta
sync_test.BenchmarkMutexUncontended                  24.10        25.40   +5.39%
sync_test.BenchmarkMutexUncontended-2                12.00        13.00   +8.33%
sync_test.BenchmarkMutexUncontended-4                 6.06         6.83  +12.71%
sync_test.BenchmarkMutexUncontended-8                 3.63         3.60   -0.83%
sync_test.BenchmarkMutexUncontended-16                2.38         2.49   +4.62%

sync_test.BenchmarkMutex                             25.00        26.40   +5.60%
sync_test.BenchmarkMutex-2                          231.00        49.00  -78.79%
sync_test.BenchmarkMutex-4                          259.00       114.00  -55.98%
sync_test.BenchmarkMutex-8                          641.00       110.00  -82.84%
sync_test.BenchmarkMutex-16                        1380.00        96.30  -93.02%

sync_test.BenchmarkMutexSlack                        24.80        26.20   +5.65%
sync_test.BenchmarkMutexSlack-2                     210.00       106.00  -49.52%
sync_test.BenchmarkMutexSlack-4                     453.00       119.00  -73.73%
sync_test.BenchmarkMutexSlack-8                    1024.00       105.00  -89.75%
sync_test.BenchmarkMutexSlack-16                   1291.00        91.90  -92.88%

sync_test.BenchmarkMutexWork                        796.00       796.00   +0.00%
sync_test.BenchmarkMutexWork-2                      399.00       401.00   +0.50%
sync_test.BenchmarkMutexWork-4                      216.00       212.00   -1.85%
sync_test.BenchmarkMutexWork-8                     1547.00       196.00  -87.33%
sync_test.BenchmarkMutexWork-16                    2754.00       287.00  -89.58%

sync_test.BenchmarkMutexWorkSlack                   792.00       800.00   +1.01%
sync_test.BenchmarkMutexWorkSlack-2                 430.00       420.00   -2.33%
sync_test.BenchmarkMutexWorkSlack-4                 467.00       230.00  -50.75%
sync_test.BenchmarkMutexWorkSlack-8                1860.00       273.00  -85.32%
sync_test.BenchmarkMutexWorkSlack-16               3029.00       294.00  -90.29%

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

13 years agoexp/regexp/syntax: finish Regexp manipulation
Russ Cox [Thu, 30 Jun 2011 14:26:22 +0000 (10:26 -0400)]
exp/regexp/syntax: finish Regexp manipulation

Except for the inevitable bug fixes, the Regexp code is done.

R=sam.thorogood, r
CC=golang-dev
https://golang.org/cl/4635082

13 years agogovet: automate test
Russ Cox [Thu, 30 Jun 2011 14:26:11 +0000 (10:26 -0400)]
govet: automate test

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

13 years agohtml: fix nesting when parsing a close tag.
Yasuhiro Matsumoto [Thu, 30 Jun 2011 13:16:33 +0000 (23:16 +1000)]
html: fix nesting when parsing a close tag.

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

13 years agogoinstall: Add support for generic hosts using special import form
Julian Phillips [Thu, 30 Jun 2011 08:54:53 +0000 (18:54 +1000)]
goinstall: Add support for generic hosts using special import form

This change extends goinstall to support "magic" package names of the
form:
        <host>/<repo>.<vcs>/<path>

Where <host> is the hostname, <repo> the path to the repository, <vcs>
the type of vcs (git, hg, bzr or svn), and <path> is the path inside the
repository that contains the source code for the package.

For example: "example.com/pub/foo.hg/src" means download the Mercurial
repository at either pub/foo.hg or pub/foo from example.com and then
build and install the source files from src inside the repository
checkout.

Repositories on the built-in hostings sites (github, bitbucket,
launchpad and googlecode) must still use the old form (i.e.
github.com/xxx/yyy.git/src will be rejected).

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

13 years agomisc/vim: allow only utf-8 for fileencoding (fix CL4625078).
Yasuhiro Matsumoto [Thu, 30 Jun 2011 07:07:44 +0000 (17:07 +1000)]
misc/vim:  allow only utf-8 for fileencoding (fix CL4625078).

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

13 years agomisc/vim: allow only utf-8 for fileencoding.
Yasuhiro Matsumoto [Thu, 30 Jun 2011 06:19:53 +0000 (16:19 +1000)]
misc/vim: allow only utf-8 for fileencoding.

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

13 years agobuild: make version.bash aware of branches
Andrew Gerrand [Thu, 30 Jun 2011 05:39:00 +0000 (15:39 +1000)]
build: make version.bash aware of branches

Fixes #2026.

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

13 years agonet: break up and simplify Dial a bit
Brad Fitzpatrick [Thu, 30 Jun 2011 04:56:13 +0000 (21:56 -0700)]
net: break up and simplify Dial a bit

No API or functional change.

R=jacek.masiulaniec, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/4630081

13 years agotime: zero-pad two-digit years.
Rob Pike [Thu, 30 Jun 2011 04:05:29 +0000 (14:05 +1000)]
time: zero-pad two-digit years.
Fixes #2024

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

13 years agoos: use a different symbol from syscall in mkunixsignals.sh.
David Symonds [Thu, 30 Jun 2011 03:35:40 +0000 (13:35 +1000)]
os: use a different symbol from syscall in mkunixsignals.sh.

Open is more likely to be present than Syscall.

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

13 years agohttp: document that ServerConn and ClientConn are low-level
Brad Fitzpatrick [Thu, 30 Jun 2011 01:23:38 +0000 (18:23 -0700)]
http: document that ServerConn and ClientConn are low-level

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

13 years agotag release.r58
Andrew Gerrand [Wed, 29 Jun 2011 23:59:44 +0000 (09:59 +1000)]
tag release.r58

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

13 years agodocument release.r58
Andrew Gerrand [Wed, 29 Jun 2011 23:45:10 +0000 (09:45 +1000)]
document release.r58

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

13 years agorun.bash: small fix
Alex Brainman [Wed, 29 Jun 2011 23:44:16 +0000 (09:44 +1000)]
run.bash: small fix

Fixes #2025.

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

13 years agohttp: make NewChunkedReader public
Andrew Balholm [Wed, 29 Jun 2011 19:27:53 +0000 (12:27 -0700)]
http: make NewChunkedReader public

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

13 years agoC+A: add Andy Balholm
Brad Fitzpatrick [Wed, 29 Jun 2011 18:46:06 +0000 (11:46 -0700)]
C+A: add Andy Balholm

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

13 years agotesting: make ResetTimer not start/stop the timer
Russ Cox [Wed, 29 Jun 2011 14:26:16 +0000 (10:26 -0400)]
testing: make ResetTimer not start/stop the timer

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

13 years agoreflect: support for struct tag use by multiple packages
Russ Cox [Wed, 29 Jun 2011 13:52:34 +0000 (09:52 -0400)]
reflect: support for struct tag use by multiple packages

Each package using struct field tags assumes that
it is the only package storing data in the tag.
This CL adds support in package reflect for sharing
tags between multiple packages.  In this scheme, the
tags must be of the form

        key:"value" key2:"value2"

(raw strings help when writing that tag in Go source).

reflect.StructField's Tag field now has type StructTag
(a string type), which has method Get(key string) string
that returns the associated value.

Clients of json and xml will need to be updated.
Code that says

        type T struct {
                X int "name"
        }

should become

        type T struct {
                X int `json:"name"`  // or `xml:"name"`
        }

Use govet to identify struct tags that need to be changed
to use the new syntax.

R=r, r, dsymonds, bradfitz, kevlar, fvbommel, n13m3y3r
CC=golang-dev
https://golang.org/cl/4645069

13 years agoruntime: windows/amd64 port
Wei Guangjing [Wed, 29 Jun 2011 07:37:56 +0000 (17:37 +1000)]
runtime: windows/amd64 port

R=rsc, alex.brainman, hectorchu, r
CC=golang-dev
https://golang.org/cl/3759042

13 years agogofix: fixes for os/signal changes
Robert Hencke [Wed, 29 Jun 2011 06:44:47 +0000 (16:44 +1000)]
gofix: fixes for os/signal changes

Fixes #1971.

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

13 years agoregexp: document that Regexp is thread-safe.
Rob Pike [Wed, 29 Jun 2011 05:41:09 +0000 (15:41 +1000)]
regexp: document that Regexp is thread-safe.

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

13 years agoexp/template: boolean constants
Rob Pike [Wed, 29 Jun 2011 05:02:04 +0000 (15:02 +1000)]
exp/template: boolean constants

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

13 years agoexp/regexp/syntax: incremental concat, alternate
Russ Cox [Wed, 29 Jun 2011 04:55:37 +0000 (00:55 -0400)]
exp/regexp/syntax: incremental concat, alternate
Also reuse of *Regexp nodes.

I believe this is the end of the parser.
The only non-execution code that remains is
the code to expand x{3,5} into simpler operations.

R=sam.thorogood, r
CC=golang-dev
https://golang.org/cl/4629078

13 years agocodereview: restrict sync to default branch
Russ Cox [Wed, 29 Jun 2011 04:45:29 +0000 (00:45 -0400)]
codereview: restrict sync to default branch

'default' is the name of the main branch,
the one that isn't a release branch.

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

13 years agogc: fix package quoting logic
Russ Cox [Wed, 29 Jun 2011 03:58:35 +0000 (23:58 -0400)]
gc: fix package quoting logic

The decision for when to say "hash/crc32".New instead of
crc32.New in an error was double-counting imports
from different packages or indirect imports, so it was
quoting even when there was no ambiguity.

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

13 years agogob: delete some unused bits from the GobEncoder/GobDecoder code.
Rob Pike [Wed, 29 Jun 2011 03:57:59 +0000 (13:57 +1000)]
gob: delete some unused bits from the GobEncoder/GobDecoder code.

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

13 years agoexp/template: fix build
Rob Pike [Wed, 29 Jun 2011 03:55:49 +0000 (13:55 +1000)]
exp/template: fix build
wrong path in Makefile. why didn't my all.bash fail?
TBR=dsymonds

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

13 years agoexp/template: use MethodByName, add to build.
Rob Pike [Wed, 29 Jun 2011 03:44:13 +0000 (13:44 +1000)]
exp/template: use MethodByName, add to build.

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

13 years agoreflect: MethodByName
Rob Pike [Wed, 29 Jun 2011 03:11:49 +0000 (13:11 +1000)]
reflect: MethodByName
It's more common to ask for methods by name than by index, so might
as well make it easy to do so.

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

13 years agoruntime/cgo: fix build
Mikio Hara [Wed, 29 Jun 2011 02:26:31 +0000 (22:26 -0400)]
runtime/cgo: fix build

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

13 years agold: fix ELF strip by removing overlap of sections
Gustavo Niemeyer [Tue, 28 Jun 2011 21:28:30 +0000 (22:28 +0100)]
ld: fix ELF strip by removing overlap of sections

The gosymtab and gopclntab sections were pointing to the proper
data, but that data was already owned by the rodata section.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.

The data for these sections was moved to after rodata, and the
gosymtab and gopclntab sections now own their respective ranges.

This change makes strip happy both with and without -s being
provided at link time.  Note that it won't remove these sections
because they are still allocated, and that's by design since
they are necessary at runtime for generating proper backtraces
and similar introspection operations.

Unlike the previous behavior, -s will now maintain zero-sized
gosymtab and gopclntab sections.  This makes the implementation
slightly cleaner.

Fixes #1242.

NOTE: Tested on Linux amd64/386/arm only.

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

13 years agocc: broken return is an error, not a warning
Russ Cox [Tue, 28 Jun 2011 20:00:55 +0000 (16:00 -0400)]
cc: broken return is an error, not a warning

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

13 years agoruntime: replace Semacquire/Semrelease implementation
Dmitriy Vyukov [Tue, 28 Jun 2011 19:09:53 +0000 (15:09 -0400)]
runtime: replace Semacquire/Semrelease implementation
1. The implementation uses distributed hash table of waitlists instead of a centralized one.
  It significantly improves scalability for uncontended semaphores.
2. The implementation provides wait-free fast-path for signalers.
3. The implementation uses less locks (1 lock/unlock instead of 5 for Semacquire).
4. runtime·ready() call is moved out of critical section.
5. Semacquire() does not call semwake().
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows:
benchmark                                        old ns/op    new ns/op    delta
runtime_test.BenchmarkSemaUncontended                58.20        36.30  -37.63%
runtime_test.BenchmarkSemaUncontended-2             199.00        18.30  -90.80%
runtime_test.BenchmarkSemaUncontended-4             327.00         9.20  -97.19%
runtime_test.BenchmarkSemaUncontended-8             491.00         5.32  -98.92%
runtime_test.BenchmarkSemaUncontended-16            946.00         4.18  -99.56%

runtime_test.BenchmarkSemaSyntNonblock               59.00        36.80  -37.63%
runtime_test.BenchmarkSemaSyntNonblock-2            167.00       138.00  -17.37%
runtime_test.BenchmarkSemaSyntNonblock-4            333.00       129.00  -61.26%
runtime_test.BenchmarkSemaSyntNonblock-8            464.00       130.00  -71.98%
runtime_test.BenchmarkSemaSyntNonblock-16          1015.00       136.00  -86.60%

runtime_test.BenchmarkSemaSyntBlock                  58.80        36.70  -37.59%
runtime_test.BenchmarkSemaSyntBlock-2               294.00       149.00  -49.32%
runtime_test.BenchmarkSemaSyntBlock-4               333.00       177.00  -46.85%
runtime_test.BenchmarkSemaSyntBlock-8               471.00       221.00  -53.08%
runtime_test.BenchmarkSemaSyntBlock-16              990.00       227.00  -77.07%

runtime_test.BenchmarkSemaWorkNonblock              829.00       832.00   +0.36%
runtime_test.BenchmarkSemaWorkNonblock-2            425.00       419.00   -1.41%
runtime_test.BenchmarkSemaWorkNonblock-4            308.00       220.00  -28.57%
runtime_test.BenchmarkSemaWorkNonblock-8            394.00       147.00  -62.69%
runtime_test.BenchmarkSemaWorkNonblock-16          1510.00       149.00  -90.13%

runtime_test.BenchmarkSemaWorkBlock                 828.00       813.00   -1.81%
runtime_test.BenchmarkSemaWorkBlock-2               428.00       436.00   +1.87%
runtime_test.BenchmarkSemaWorkBlock-4               232.00       219.00   -5.60%
runtime_test.BenchmarkSemaWorkBlock-8               392.00       251.00  -35.97%
runtime_test.BenchmarkSemaWorkBlock-16             1524.00       298.00  -80.45%

sync_test.BenchmarkMutexUncontended                  24.10        24.00   -0.41%
sync_test.BenchmarkMutexUncontended-2                12.00        12.00   +0.00%
sync_test.BenchmarkMutexUncontended-4                 6.25         6.17   -1.28%
sync_test.BenchmarkMutexUncontended-8                 3.43         3.34   -2.62%
sync_test.BenchmarkMutexUncontended-16                2.34         2.32   -0.85%

sync_test.BenchmarkMutex                             24.70        24.70   +0.00%
sync_test.BenchmarkMutex-2                          208.00        99.50  -52.16%
sync_test.BenchmarkMutex-4                         2744.00       256.00  -90.67%
sync_test.BenchmarkMutex-8                         5137.00       556.00  -89.18%
sync_test.BenchmarkMutex-16                        5368.00      1284.00  -76.08%

sync_test.BenchmarkMutexSlack                        24.70        25.00   +1.21%
sync_test.BenchmarkMutexSlack-2                    1094.00       186.00  -83.00%
sync_test.BenchmarkMutexSlack-4                    3430.00       402.00  -88.28%
sync_test.BenchmarkMutexSlack-8                    5051.00      1066.00  -78.90%
sync_test.BenchmarkMutexSlack-16                   6806.00      1363.00  -79.97%

sync_test.BenchmarkMutexWork                        793.00       792.00   -0.13%
sync_test.BenchmarkMutexWork-2                      398.00       398.00   +0.00%
sync_test.BenchmarkMutexWork-4                     1441.00       308.00  -78.63%
sync_test.BenchmarkMutexWork-8                     8532.00       847.00  -90.07%
sync_test.BenchmarkMutexWork-16                    8225.00      2760.00  -66.44%

sync_test.BenchmarkMutexWorkSlack                   793.00       793.00   +0.00%
sync_test.BenchmarkMutexWorkSlack-2                 418.00       414.00   -0.96%
sync_test.BenchmarkMutexWorkSlack-4                4481.00       480.00  -89.29%
sync_test.BenchmarkMutexWorkSlack-8                6317.00      1598.00  -74.70%
sync_test.BenchmarkMutexWorkSlack-16               9111.00      3038.00  -66.66%

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

13 years agofmt: rename errno and error to err for doc consistency
Brad Fitzpatrick [Tue, 28 Jun 2011 18:00:31 +0000 (11:00 -0700)]
fmt: rename errno and error to err for doc consistency

The public godoc looked confused. I imagine these were
written before current conventions were established.

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

13 years agoruntime/cgo: check for errors from pthread_create
Albert Strasheim [Tue, 28 Jun 2011 16:04:50 +0000 (12:04 -0400)]
runtime/cgo: check for errors from pthread_create

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

13 years agoruntime: add Semacquire/Semrelease benchmarks
Dmitriy Vyukov [Tue, 28 Jun 2011 15:15:24 +0000 (11:15 -0400)]
runtime: add Semacquire/Semrelease benchmarks

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

13 years agosync: add fast path to Once
Dmitriy Vyukov [Tue, 28 Jun 2011 13:43:01 +0000 (09:43 -0400)]
sync: add fast path to Once
The implementation does not grab the lock,
if Once is already initalized.
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows:
benchmark                                        old ns/op    new ns/op    delta
sync_test.BenchmarkOnce                             187.00        14.00  -92.51%
sync_test.BenchmarkOnce-2                           909.00        21.40  -97.65%
sync_test.BenchmarkOnce-4                          3684.00        20.90  -99.43%
sync_test.BenchmarkOnce-8                          5987.00        23.00  -99.62%
sync_test.BenchmarkOnce-16                         5051.00        21.60  -99.57%

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

13 years agoAdd the beginnings of the template execution code. Lots still to do,
Rob Pike [Tue, 28 Jun 2011 13:04:08 +0000 (23:04 +1000)]
Add the beginnings of the template execution code.  Lots still to do,
including evaluation up the data tree (in this code all fields must be
in dot itself), plus more control structure, but the basics are in place.

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

13 years agosync: replace Mutex benchmarks
Dmitriy Vyukov [Tue, 28 Jun 2011 12:14:54 +0000 (08:14 -0400)]
sync: replace Mutex benchmarks
For both contended and uncontended case:
 - support arbitrary number of cpus (not just 2)
 - dynamic load balancing (improves stability)
 - periodic execution of Gosched() to work around non-preemptiviness
For uncontended case eliminates possible false-sharing.
For contended case includes additional variation with some
amount of local work between mutex operations.

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

13 years agoio.WriteString: if the object has a WriteString method, use it
Evan Shaw [Tue, 28 Jun 2011 06:10:39 +0000 (16:10 +1000)]
io.WriteString: if the object has a WriteString method, use it

This avoids allocation when writing to bytes.Buffers and bufio.Writers, for
example.

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

13 years agobuilder: minor fixes
Andrew Gerrand [Tue, 28 Jun 2011 06:01:52 +0000 (16:01 +1000)]
builder: minor fixes

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

13 years agomime/multipart: parse LF-delimited messages, not just CRLF
Brad Fitzpatrick [Tue, 28 Jun 2011 04:59:51 +0000 (21:59 -0700)]
mime/multipart: parse LF-delimited messages, not just CRLF

Against the spec, but appear in the wild.

Fixes #1966

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

13 years agoexp/regexp/syntax: case-folding in character classes
Russ Cox [Tue, 28 Jun 2011 03:23:51 +0000 (23:23 -0400)]
exp/regexp/syntax: case-folding in character classes

Also fix \x{123} parsing.

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

13 years agoruntime: another attempt to allow stdcall to be used from both 386 and amd64 arch
Alex Brainman [Tue, 28 Jun 2011 02:46:16 +0000 (12:46 +1000)]
runtime: another attempt to allow stdcall to be used from both 386 and amd64 arch

R=rsc
CC=golang-dev, vcc.163
https://golang.org/cl/4627071

13 years agocc: add two new #pragma varargck
Russ Cox [Tue, 28 Jun 2011 02:42:34 +0000 (22:42 -0400)]
cc: add two new #pragma varargck

#pragma varargck countpos f 1
says that the first argument to f is
the count of variadic arguments that follow.

#pragma varargck type f t
says that t is one of the allowed types for
a variadic argument to f.
(can be repeated)

combined, these can be used to check the
runtime.stdcall functions in the windows port
or in any other port that needs a vararg list of
uintptrs even on a 64-bit platform (where it is
very easy to pass a less-than-uintptr in the ...).

demo:

typedef unsigned int uintptr;

#pragma varargck countpos f 1
#pragma varargck type f uintptr
#pragma varargck type f void*

int f(int count, ...);

void *v;
char *p;

void
main(void)
{
        f(1, v);  // ok
        f(1, main);  // ok
        f(1, p);  // ok
        f(2, v, v);  // ok

        f(2, v);  // found 1 argument after count 2
        f(1, 'a');  // invalid type INT in call to f
        f(1, 0);  // invalid type INT in call to f
}

R=ken, r, alex.brainman
CC=golang-dev
https://golang.org/cl/4634103

13 years agoos: simplify WriteString
Rob Pike [Tue, 28 Jun 2011 01:09:21 +0000 (11:09 +1000)]
os: simplify WriteString
It was working too hard.

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

13 years agoexp/regexp/syntax: compiled form
Russ Cox [Mon, 27 Jun 2011 23:52:59 +0000 (19:52 -0400)]
exp/regexp/syntax: compiled form

R=r, sam.thorogood, kevlar
CC=golang-dev, rsc
https://golang.org/cl/4636046

13 years agostrings.Split: make the default to split all.
Rob Pike [Mon, 27 Jun 2011 23:43:14 +0000 (09:43 +1000)]
strings.Split: make the default to split all.
Change the signature of Split to have no count,
assuming a full split, and rename the existing
Split with a count to SplitN.
Do the same to package bytes.
Add a gofix module.

R=adg, dsymonds, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4661051

13 years agosyscall: support for tty options in StartProcess
Ken Rockot [Mon, 27 Jun 2011 23:07:49 +0000 (19:07 -0400)]
syscall: support for tty options in StartProcess

These are the relevant changes to exec_unix.go now that
mkerrors.sh outputs have been updated.

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

13 years agoxml: add Marshal and MarshalIndent
Kyle Lemons [Mon, 27 Jun 2011 23:07:28 +0000 (19:07 -0400)]
xml: add Marshal and MarshalIndent

I have written up a Marshal and MarshalIndent pair that should
closely reflect the way that Unmarshal works.  I would love feedback
on making this code more accessible and efficient... I haven't used
reflecton on this scale before, so there is probably a lot of work
that can be done on that.

Some potentially controversial things:
- All tag names are lower-cased by default.
- Zero-valued struct values are skipped.
- No namespace prefix (o:tag, etc) mechanism is supplied.
- You are allowed to marshal non-struct values (even though unmarshal
  cannot handle them).
- A tag for a non-XMLName struct field that isn't "attr", "chardata",
  or "innerxml" is used as the name of the tag.  This could wreak
  havoc if you try to marshal a protobuf struct.
- The "innerxml" and "chardata" are inserted verbatim.  If you try to
  marshal something straight from unmarshal, the results could be
  unexpected (remove "innerxml" support from Marshal would be one
  possible solution).

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

13 years agoCONTRIBUTORS: update Rietveld address for Kyle Lemons
Russ Cox [Mon, 27 Jun 2011 23:07:22 +0000 (19:07 -0400)]
CONTRIBUTORS: update Rietveld address for Kyle Lemons

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

13 years agohttp: respect Handlers setting Connection: close in their response
Brad Fitzpatrick [Mon, 27 Jun 2011 22:53:48 +0000 (15:53 -0700)]
http: respect Handlers setting Connection: close in their response

Fixes #2011

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

13 years agotesting: scale benchmark precision to 0.01ns if needed
Russ Cox [Mon, 27 Jun 2011 22:50:27 +0000 (18:50 -0400)]
testing: scale benchmark precision to 0.01ns if needed

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

13 years agogc: avoid package name ambiguity in error messages
Russ Cox [Mon, 27 Jun 2011 22:44:30 +0000 (18:44 -0400)]
gc: avoid package name ambiguity in error messages

Fixes #2006.

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

13 years agohttp: add FileSystem interface, make FileServer use it
Brad Fitzpatrick [Mon, 27 Jun 2011 22:26:36 +0000 (15:26 -0700)]
http: add FileSystem interface, make FileServer use it

Permits serving from virtual filesystems, such as files linked
into a binary, or from a zip file.

Also adds a gofix for:

http.FileServer(root, prefix) -> http.StripPrefix(prefix, http.FileServer(http.Dir(root)))

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

13 years agobufio: do not cache Read errors
Graham Miller [Mon, 27 Jun 2011 20:12:04 +0000 (16:12 -0400)]
bufio: do not cache Read errors

Reader previously had cached an error from the underlying reader
and would return it on every subsequent call to Read.  The Reader
will now return the error only once, and subsequent calls will result
in a new Read call to the underlying Reader.

Fixes #1934.

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

13 years agosync: add benchmark for Once.
Dmitriy Vyukov [Mon, 27 Jun 2011 20:02:13 +0000 (16:02 -0400)]
sync: add benchmark for Once.

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

13 years ago8a: fixes for Plan 9 build
Lucio De Re [Mon, 27 Jun 2011 18:42:18 +0000 (14:42 -0400)]
8a: fixes for Plan 9 build

8a/a.h:
. Removed <u.h> and <libc.h> includes as they work better in "a.y".
. Made definition of EOF conditional as it's defined in the Plan 9
  header files, but not elsewhere.

8a/a.y:
. Added <u.h> and <libc.h> because <stdio.h> in Plan 9 needs them.
  Sequence <u.h>, <stdio.h>, <libc.h> recommended by RSC.

8a/lex.c:
. Added <u.h> and <libc.h> as now needed by "a.h".
. Dropped <ctype.h>.

cc/lexbody:
. exit() -> exits().
. Dropped unwanted incrementation.

cc/macbody:
. Adjusted a few format specifications.

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

13 years agold: elide the Go symbol table when using -s
Anthony Martin [Mon, 27 Jun 2011 18:39:38 +0000 (14:39 -0400)]
ld: elide the Go symbol table when using -s

R=rsc, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/4661050

13 years agobuild: use correct list of required programs
Russ Cox [Mon, 27 Jun 2011 18:30:02 +0000 (14:30 -0400)]
build: use correct list of required programs

R=golang-dev, bradfitz, go.peter.90
CC=golang-dev
https://golang.org/cl/4627068

13 years agohttp: add StripPrefix handler wrapper
Brad Fitzpatrick [Mon, 27 Jun 2011 18:03:43 +0000 (11:03 -0700)]
http: add StripPrefix handler wrapper

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

13 years agocodereview: make --ignore_hgpatch_failure work again
Russ Cox [Mon, 27 Jun 2011 17:45:17 +0000 (13:45 -0400)]
codereview: make --ignore_hgpatch_failure work again

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

13 years agohttp: do TLS handshake explicitly before copying TLS state
Brad Fitzpatrick [Mon, 27 Jun 2011 17:37:33 +0000 (10:37 -0700)]
http: do TLS handshake explicitly before copying TLS state

Previously we were snapshotting the TLS state into *Request
before we did the HTTP ReadRequest, the first Read of which
triggered the TLS handshake implicitly.

Fixes #1956

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

13 years agogotest: add -test.benchtime and -test.cpu flags.
Dmitriy Vyukov [Mon, 27 Jun 2011 17:31:40 +0000 (13:31 -0400)]
gotest: add -test.benchtime and -test.cpu flags.
-test.benchtime allows to specify benchmark execution time.
-test.cpu allows to execute tests/benchmarks for several
values of GOMAXPROCS.

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

13 years ago5l, 6l, 8l: drop use of ed during build
Russ Cox [Mon, 27 Jun 2011 16:03:19 +0000 (12:03 -0400)]
5l, 6l, 8l: drop use of ed during build

build runs with chmod 0 /bin/ed now

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

13 years agosyscall: regenerate zerrors for darwin/linux/freebsd
Russ Cox [Mon, 27 Jun 2011 15:02:32 +0000 (11:02 -0400)]
syscall: regenerate zerrors for darwin/linux/freebsd

did darwin on mac with older, not broken xcode.
did linux arm by copying diffs from linux 386.
did freebsd amd64 by copying diffs from freebsd 386.

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

13 years agocrypto: replace "crypto/block" with "crypto/cipher" in comments
Dmitry Chestnykh [Mon, 27 Jun 2011 13:16:42 +0000 (09:16 -0400)]
crypto: replace "crypto/block" with "crypto/cipher" in comments

Documentation mentioned the obsolete package "crypto/block",
which has been replaced with "crypto/cipher".

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

13 years agogofix: fixes for path/filepath changes
Robert Hencke [Sun, 26 Jun 2011 01:24:28 +0000 (11:24 +1000)]
gofix: fixes for path/filepath changes

Fixes #1970.

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

13 years agogofix: fixes for sort changes
Robert Hencke [Sat, 25 Jun 2011 22:48:53 +0000 (08:48 +1000)]
gofix: fixes for sort changes

Fixes #1969.

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

13 years agoebnflint: better handling of stdin
Robert Griesemer [Sat, 25 Jun 2011 00:29:19 +0000 (17:29 -0700)]
ebnflint: better handling of stdin

- don't rely on /dev/stdin as the name for standard input
- employ EBNF extraction if the source contains tags

"cat source.html | ebnflint" works now

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

13 years agofmt: Added SkipSpace() function to fmt's ScanState interface.
Michael T. Jones [Sat, 25 Jun 2011 00:26:45 +0000 (17:26 -0700)]
fmt: Added SkipSpace() function to fmt's ScanState interface.

Users of the Scan() infrastructure that employ ReadRune() rather than
Token() need a way to skip leading spaces and newlines as set by the
the parent, Fscan(), Fscanln, or Fscanf(). As the internal methods and
boolean flags are not exported, this new function was added here and
in the Int and Nat Scan() functions of the big package. (fmt.Rat did
not need change since it uses Token()) Also added Printf style format
code support to int types and tests for same to int_test.go

R=r, r, gri, mtj
CC=golang-dev
https://golang.org/cl/4634074

13 years agohttp: better handling of 0-length Request.Body
Brad Fitzpatrick [Fri, 24 Jun 2011 23:46:14 +0000 (16:46 -0700)]
http: better handling of 0-length Request.Body

As rsc suggested after change 58a6bdac3d12 was committed, we
now read the first byte of Request.Body when the
Request.ContentLength is 0 to disambiguate between a truly
zero-length body and a body of unknown length where the user
didn't set the ContentLength field.

This was also causing the reverse proxy problem where incoming
requests (which always have a body, of private type http.body,
even for 0-lengthed requests) were being relayed to the http
Transport for fetching, which was serializing the request as a
chunked request (since ContentLength was 0 and Body was
non-nil)

Fixes #1999

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4628063

13 years agohttp: assume ContentLength 0 on GET requests
Brad Fitzpatrick [Fri, 24 Jun 2011 20:48:12 +0000 (13:48 -0700)]
http: assume ContentLength 0 on GET requests

Incremental step in fix for issue 1999

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4667041

13 years agomime: lower-case media type parameters
Pascal S. de Kloe [Fri, 24 Jun 2011 18:32:06 +0000 (11:32 -0700)]
mime: lower-case media type parameters
        RFC 1521 section 4 states "The type, subtype, and parameter names are not case sensitive.".

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

13 years agoos: remove duplicate package description
Robert Hencke [Fri, 24 Jun 2011 18:23:49 +0000 (11:23 -0700)]
os: remove duplicate package description

file.go contains a more complete package description.

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

13 years agomisc/emacs: update list of builtins.
Quan Yong Zhai [Fri, 24 Jun 2011 18:19:48 +0000 (11:19 -0700)]
misc/emacs: update list of builtins.

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

13 years agopath/filepath: enable TestWalk to run on windows
Alex Brainman [Fri, 24 Jun 2011 09:18:59 +0000 (19:18 +1000)]
path/filepath: enable TestWalk to run on windows

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

13 years agotag weekly.2011-06-23
Andrew Gerrand [Fri, 24 Jun 2011 06:18:39 +0000 (16:18 +1000)]
tag weekly.2011-06-23

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

13 years agoweekly.2011-06-23 weekly.2011-06-23
Andrew Gerrand [Fri, 24 Jun 2011 06:04:17 +0000 (16:04 +1000)]
weekly.2011-06-23

R=golang-dev, robert.hencke, r
CC=golang-dev
https://golang.org/cl/4625062

13 years agoos: fixed PathListSeparator to ';' for windows.
Yasuhiro Matsumoto [Fri, 24 Jun 2011 05:00:59 +0000 (15:00 +1000)]
os: fixed PathListSeparator to ';' for windows.
Fixed issue 1992

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

13 years agohttp: buffer Request.Write
Brad Fitzpatrick [Fri, 24 Jun 2011 04:10:51 +0000 (21:10 -0700)]
http: buffer Request.Write

Fixes #1996

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

13 years agoruntime: don't use twice the memory with grsec-like kernels
Gustavo Niemeyer [Fri, 24 Jun 2011 03:29:59 +0000 (00:29 -0300)]
runtime: don't use twice the memory with grsec-like kernels

grsec needs the FIXED flag to be provided to mmap, which
works now.  That said, when the allocation fails to be made
in the specific address, we're still given back a writable
page.  This change will unmap that page to avoid using
twice the amount of memory needed.

It'd also be pretty easy to avoid the extra system calls
once we detected that the flag is needed, but I'm not sure
if that edge case is worth the effort.

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

13 years agogoinstall: build with make by default, add -make flag
Andrew Gerrand [Fri, 24 Jun 2011 03:01:17 +0000 (13:01 +1000)]
goinstall: build with make by default, add -make flag

This is a temporary measure until go/build can build cgo packages.

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

13 years agomime/multipart: remove newline at top of the multipart.
Yasuhiro Matsumoto [Thu, 23 Jun 2011 17:11:33 +0000 (10:11 -0700)]
mime/multipart: remove newline at top of the multipart.

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

13 years agolibmach: fix disassembly of FCMOVcc and FCOMI
Anthony Martin [Thu, 23 Jun 2011 13:32:29 +0000 (09:32 -0400)]
libmach: fix disassembly of FCMOVcc and FCOMI

The optable for 0xDB is handled specially.

This was the cause of a really weird bug
when using cov (386!) on the math package.

A real head-scratcher.

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