]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogodoc: fix build (add Makefile change)
Robert Griesemer [Thu, 14 Jul 2011 18:48:23 +0000 (11:48 -0700)]
godoc: fix build (add Makefile change)

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

13 years agogodoc: support for file systems stored in .zip files
Robert Griesemer [Thu, 14 Jul 2011 18:34:53 +0000 (11:34 -0700)]
godoc: support for file systems stored in .zip files

Instead of serving files of the underlying OS file system,
a .zip file may be provided to godoc containing the files
to serve; for instance:

   godoc -http=:6060 -zip=go.zip

using a .zip file created from a clean tree as follows:

   zip -r go.zip $GOROOT

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

13 years agogc: fix closure bug
Luuk van Dijk [Thu, 14 Jul 2011 16:13:39 +0000 (18:13 +0200)]
gc: fix closure bug

Fixes #2056.

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

13 years agojson: escape < and > in any JSON string.
David Symonds [Thu, 14 Jul 2011 03:30:08 +0000 (13:30 +1000)]
json: escape < and > in any JSON string.

Angle brackets can trigger some browser sniffers, causing
some forms of JSON output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

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

13 years agoexp/template: allow range actions to declare a key and element variable.
Rob Pike [Thu, 14 Jul 2011 03:15:55 +0000 (13:15 +1000)]
exp/template: allow range actions to declare a key and element variable.
        {{range $key, $element := pipeline}}
This CL is smaller than it looks due to some rearrangement and renaming.

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

13 years agomime: fix build
Russ Cox [Thu, 14 Jul 2011 03:04:12 +0000 (20:04 -0700)]
mime: fix build

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

13 years agoexp/template: escape < and > in JS escaper.
David Symonds [Thu, 14 Jul 2011 02:02:58 +0000 (12:02 +1000)]
exp/template: escape < and > in JS escaper.

Angle brackets can trigger some browser sniffers,
causing some output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

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

13 years agoexp/template: include function name in error returned by function or method call.
Rob Pike [Thu, 14 Jul 2011 01:32:06 +0000 (11:32 +1000)]
exp/template: include function name in error returned by function or method call.

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

13 years agoexp/template: simplify method and function calls by using the value's Method
Rob Pike [Thu, 14 Jul 2011 01:00:23 +0000 (11:00 +1000)]
exp/template: simplify method and function calls by using the value's Method
rather than the type's, so a method's invocation works the same as a function's.

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

13 years agojson: allow using '$' and '-' as the struct field's tag
Mikio Hara [Thu, 14 Jul 2011 00:41:33 +0000 (17:41 -0700)]
json: allow using '$' and '-' as the struct field's tag

R=adg, rsc, bradfitz, mattn.jp, gustavo
CC=golang-dev
https://golang.org/cl/4625081

13 years agoreflect: trivial addition: Value.NumMethod.
Rob Pike [Thu, 14 Jul 2011 00:38:15 +0000 (10:38 +1000)]
reflect: trivial addition: Value.NumMethod.
Just an oversight it was missing.

R=rsc, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/4695059

13 years agoos: Plan 9: add Process.Signal as a way to send notes.
Yuval Pavel Zholkover [Wed, 13 Jul 2011 23:29:37 +0000 (16:29 -0700)]
os: Plan 9: add Process.Signal as a way to send notes.
Move the Signal interface from exec_posix.go to exec.go.
Remove some unsused code from file_plan9.go.

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

13 years agoruntime: correct FixedStack value (fixes windows build)
Alex Brainman [Wed, 13 Jul 2011 23:13:39 +0000 (09:13 +1000)]
runtime: correct FixedStack value (fixes windows build)

Fixes #2068.

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

13 years agocc: fixes for Plan 9 build
Lucio De Re [Wed, 13 Jul 2011 23:01:29 +0000 (16:01 -0700)]
cc: fixes for Plan 9 build

<ctype.h> has been moved into <u.h>, specifically to be able to
drop it from these modules.

Will someone check platforms other than UBUNTU/386, please?

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

13 years agofix build from e904b6784768 breakage
Brad Fitzpatrick [Wed, 13 Jul 2011 22:48:57 +0000 (15:48 -0700)]
fix build from e904b6784768 breakage

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

13 years agosyscall: add Flock on Linux
Russ Cox [Wed, 13 Jul 2011 22:34:36 +0000 (15:34 -0700)]
syscall: add Flock on Linux

Fixes #2069.

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

13 years agosyscall: change missing from windows net fixes
Russ Cox [Wed, 13 Jul 2011 22:34:21 +0000 (15:34 -0700)]
syscall: change missing from windows net fixes

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

13 years agofilepath/path: fix a comment
Robert Griesemer [Wed, 13 Jul 2011 22:10:50 +0000 (15:10 -0700)]
filepath/path: fix a comment

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

13 years agoexp/template: tweak behavior of booleans.
Rob Pike [Wed, 13 Jul 2011 21:59:04 +0000 (07:59 +1000)]
exp/template: tweak behavior of booleans.
Russ suggested this technique, making the "and" and "or" functions handier.
But it's hacky, and I can be talked out of it.

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

13 years agoexp/template: allow niladic methods inside chained field references.
Rob Pike [Wed, 13 Jul 2011 21:52:07 +0000 (07:52 +1000)]
exp/template: allow niladic methods inside chained field references.
Also really fix the bug about dot vs. receivers.

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

13 years agohttp: fix Content-Type of file extension.
Yasuhiro Matsumoto [Wed, 13 Jul 2011 21:39:33 +0000 (14:39 -0700)]
http: fix Content-Type of file extension.
ServeFile() pass empty string to serveFile(). serveFile() should get
file extension via joining root and filename.

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

13 years agonet: windows/amd64 port
Wei Guangjing [Wed, 13 Jul 2011 19:44:21 +0000 (12:44 -0700)]
net: windows/amd64 port

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

13 years agodebug/elf: Read ELF Program headers.
Matthew Horsnell [Wed, 13 Jul 2011 19:34:29 +0000 (12:34 -0700)]
debug/elf: Read ELF Program headers.

NewFile has been fixed to read ELF Program headers into the structs.
Added test coverage.

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

13 years agoA+C: Matthew Horsnell (individual CLA)
Russ Cox [Wed, 13 Jul 2011 19:33:03 +0000 (12:33 -0700)]
A+C: Matthew Horsnell (individual CLA)

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

13 years agoruntime: stdcall_raw stack 16byte align for Win64
Wei Guangjing [Wed, 13 Jul 2011 18:44:44 +0000 (11:44 -0700)]
runtime: stdcall_raw stack 16byte align for Win64

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

13 years agoruntime: fix data race during Itab hash update/lookup
Dmitriy Vyukov [Wed, 13 Jul 2011 18:22:41 +0000 (11:22 -0700)]
runtime: fix data race during Itab hash update/lookup
The data race is on newly published Itab nodes, which are
both unsafely published and unsafely acquired. It can
break on IA-32/Intel64 due to compiler optimizations
(most likely not an issue as of now) and on ARM due to
hardware memory access reorderings.

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

13 years agodocs: fix wrong it's -> its
Brad Fitzpatrick [Wed, 13 Jul 2011 17:54:51 +0000 (10:54 -0700)]
docs: fix wrong it's -> its

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

13 years agoexp/regexp/syntax: add Prog.NumCap
Sam Thorogood [Wed, 13 Jul 2011 17:15:00 +0000 (10:15 -0700)]
exp/regexp/syntax: add Prog.NumCap

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

13 years agoexp/eval, exp/ogle: remove packages eval and ogle
Robert Griesemer [Wed, 13 Jul 2011 16:40:53 +0000 (09:40 -0700)]
exp/eval, exp/ogle: remove packages eval and ogle

An externally maintained version of exp/eval can
be found at: https://bitbucket.org/binet/go-eval/ .

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

13 years agogob: register more slice types
Bobby Powers [Wed, 13 Jul 2011 07:12:17 +0000 (17:12 +1000)]
gob: register more slice types

Without explicitly registering slice types, gob fails to encode
map[string]interface{} instances where the value is a slice,
failing with a message such as:

  gob: type not registered for interface: []string

Fixes #2065.

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

13 years agohtml: update section references in comments to the latest HTML5 spec.
Nigel Tao [Wed, 13 Jul 2011 06:53:02 +0000 (16:53 +1000)]
html: update section references in comments to the latest HTML5 spec.

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

13 years agoC+A: Bobby Powers <bobbypowers@gmail.com>
Rob Pike [Wed, 13 Jul 2011 06:10:12 +0000 (16:10 +1000)]
C+A: Bobby Powers <bobbypowers@gmail.com>

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

13 years agoexp/template: doc and API changes suggested by rsc.
Rob Pike [Wed, 13 Jul 2011 05:58:31 +0000 (15:58 +1000)]
exp/template: doc and API changes suggested by rsc.
- template invocation is by string constant only.
- NewSet is gone.
- no global Funcs
- writer is now first arg to Execute

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

13 years agoexp/template: add Set.AddSet and Set.Union.
Rob Pike [Wed, 13 Jul 2011 03:50:05 +0000 (13:50 +1000)]
exp/template: add Set.AddSet and Set.Union.
Document and test that Set.Parse can be called multiple times.

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

13 years agoexp/template: allow variables as template names.
Rob Pike [Wed, 13 Jul 2011 03:21:18 +0000 (13:21 +1000)]
exp/template: allow variables as template names.
Just an oversight it wasn't already there.
Thanks to islandberry@live.com for pointing out the omission.

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

13 years agogo_tutorial: change the way it's generated.
Rob Pike [Wed, 13 Jul 2011 03:20:05 +0000 (13:20 +1000)]
go_tutorial: change the way it's generated.
No longer do we generate HTML from it; instead the input
file is already in HTML but has template invocations to
extract programs from other files.
Delete htmlgen, which is no longer needed.
Add tmpltohtml, which runs the templating code.

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

13 years ago5l, 6l, 8l: Add a PT_LOAD PHDR entry for the PHDR.
David Anderson [Wed, 13 Jul 2011 00:49:55 +0000 (17:49 -0700)]
5l, 6l, 8l: Add a PT_LOAD PHDR entry for the PHDR.

Per the TIS ELF spec, if a PHDR entry is present in the
program header table, it must be part of the memory image of
the program. Failure to do this makes elflint complain, and
causes some tools that manipulate ELF to crash.

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

13 years agocsv: fix spelling errors in comments
Robert Griesemer [Wed, 13 Jul 2011 00:45:29 +0000 (17:45 -0700)]
csv: fix spelling errors in comments

Fixes #2066.

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

13 years agotag release.r58.1: adds OS X Lion support
Russ Cox [Wed, 13 Jul 2011 00:44:59 +0000 (17:44 -0700)]
tag release.r58.1: adds OS X Lion support

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

13 years agoruntime: replace runtime.mcpy with runtime.memmove
Quan Yong Zhai [Wed, 13 Jul 2011 00:30:40 +0000 (17:30 -0700)]
runtime: replace runtime.mcpy with runtime.memmove
faster string operations, and more

tested on linux/386

runtime_test.BenchmarkSliceToString                    642          532  -17.13%
runtime_test.BenchmarkStringToSlice                    636          528  -16.98%
runtime_test.BenchmarkConcatString                    1109          897  -19.12%

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

13 years agodoc: gofix io2010 demo programs
Andrew Gerrand [Tue, 12 Jul 2011 23:40:49 +0000 (09:40 +1000)]
doc: gofix io2010 demo programs

R=golang-dev, gri, r, agl
CC=golang-dev
https://golang.org/cl/4696046

13 years agodebug/pe: fixes ImportedSymbols for Win64.
Wei Guangjing [Tue, 12 Jul 2011 18:29:38 +0000 (11:29 -0700)]
debug/pe: fixes ImportedSymbols for Win64.

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

13 years agogc: make size of struct{} and [0]byte 0 bytes
Robert Hencke [Tue, 12 Jul 2011 18:12:06 +0000 (11:12 -0700)]
gc: make size of struct{} and [0]byte 0 bytes

Fixes #1949.

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

13 years agoruntime: eliminate false sharing during stack growth
Dmitriy Vyukov [Tue, 12 Jul 2011 17:56:21 +0000 (10:56 -0700)]
runtime: eliminate false sharing during stack growth
Remove static variable from runtime·oldstack().
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows (with CL 4657091 applied):
benchmark                                        old ns/op    new ns/op    delta
BenchmarkStackGrowth                               1183.00      1180.00   -0.25%
BenchmarkStackGrowth-2                             1249.00      1211.00   -3.04%
BenchmarkStackGrowth-4                              954.00       805.00  -15.62%
BenchmarkStackGrowth-8                              701.00       683.00   -2.57%
BenchmarkStackGrowth-16                             465.00       415.00  -10.75%

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

13 years agoruntime: fix comment (lost in shuffle)
Russ Cox [Tue, 12 Jul 2011 16:26:05 +0000 (09:26 -0700)]
runtime: fix comment (lost in shuffle)

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/4710041

13 years agoruntime: eliminate contention during stack allocation
Dmitriy Vyukov [Tue, 12 Jul 2011 16:24:32 +0000 (09:24 -0700)]
runtime: eliminate contention during stack allocation
Standard-sized stack frames use plain malloc/free
instead of centralized lock-protected FixAlloc.
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
BenchmarkStackGrowth                               1045.00       949.00   -9.19%
BenchmarkStackGrowth-2                             3450.00       800.00  -76.81%
BenchmarkStackGrowth-4                             5076.00       513.00  -89.89%
BenchmarkStackGrowth-8                             7805.00       471.00  -93.97%
BenchmarkStackGrowth-16                           11751.00       321.00  -97.27%

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

13 years agosync: improve RWMutex performance
Dmitriy Vyukov [Tue, 12 Jul 2011 16:24:21 +0000 (09:24 -0700)]
sync: improve RWMutex performance
The new implementation features wait-free
fast path for readers which significantly improves
performance/scalability on read-mostly workloads.
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
BenchmarkRWMutexUncontended               179.00        96.60  -46.03%
BenchmarkRWMutexUncontended-2              89.10        49.10  -44.89%
BenchmarkRWMutexUncontended-4              44.70        24.70  -44.74%
BenchmarkRWMutexUncontended-8              23.30        12.90  -44.64%
BenchmarkRWMutexUncontended-16             16.80         8.75  -47.92%
BenchmarkRWMutexWrite100                   79.60        26.80  -66.33%
BenchmarkRWMutexWrite100-2                305.00        33.00  -89.18%
BenchmarkRWMutexWrite100-4                245.00       113.00  -53.88%
BenchmarkRWMutexWrite100-8                330.00       147.00  -55.45%
BenchmarkRWMutexWrite100-16               371.00       152.00  -59.03%
BenchmarkRWMutexWrite10                    78.30        29.80  -61.94%
BenchmarkRWMutexWrite10-2                 348.00       165.00  -52.59%
BenchmarkRWMutexWrite10-4                 447.00       199.00  -55.48%
BenchmarkRWMutexWrite10-8                 564.00       180.00  -68.09%
BenchmarkRWMutexWrite10-16                492.00       192.00  -60.98%
BenchmarkRWMutexWorkWrite100             1077.00      1037.00   -3.71%
BenchmarkRWMutexWorkWrite100-2            659.00       596.00   -9.56%
BenchmarkRWMutexWorkWrite100-4            509.00       361.00  -29.08%
BenchmarkRWMutexWorkWrite100-8            603.00       351.00  -41.79%
BenchmarkRWMutexWorkWrite100-16           750.00       607.00  -19.07%
BenchmarkRWMutexWorkWrite10               990.00       951.00   -3.94%
BenchmarkRWMutexWorkWrite10-2            1119.00      1070.00   -4.38%
BenchmarkRWMutexWorkWrite10-4            1300.00      1199.00   -7.77%
BenchmarkRWMutexWorkWrite10-8            1424.00      1291.00   -9.34%
BenchmarkRWMutexWorkWrite10-16           1981.00      1786.00   -9.84%

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

13 years agoeffective go: tweak the words about semicolons, parens in control structures,
Rob Pike [Tue, 12 Jul 2011 13:45:10 +0000 (23:45 +1000)]
effective go: tweak the words about semicolons, parens in control structures,
and make and new.

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

13 years agohash/crc32: add SSE4.2 support
Adam Langley [Tue, 12 Jul 2011 13:29:24 +0000 (09:29 -0400)]
hash/crc32: add SSE4.2 support

Using the CRC32 instruction speeds up the Castagnoli computation by
about 20x on a modern Intel CPU.

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

13 years agogo/build: include processing of .c files for cgo packages
Alex Brainman [Tue, 12 Jul 2011 07:27:07 +0000 (17:27 +1000)]
go/build: include processing of .c files for cgo packages

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

13 years agoimage: remove superfluous if condition.
Nigel Tao [Tue, 12 Jul 2011 07:02:55 +0000 (17:02 +1000)]
image: remove superfluous if condition.

DrawMask already returns early if r.Empty().

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

13 years agoimage: re-organize draw.go.
Nigel Tao [Tue, 12 Jul 2011 06:56:29 +0000 (16:56 +1000)]
image: re-organize draw.go.

There are no behavioral changes, only some copy-and-pastes.

Before, drawFillOver was next to drawCopyOver.

After, drawFillOver is next to drawFillSrc, which is more similar to
drawFillOver than drawCopyOver is.

Similarly, drawCopyOver is now next to drawCopySrc, etc.

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

13 years agoimage: change Pix from []FooColor to []uint8.
Nigel Tao [Tue, 12 Jul 2011 06:39:38 +0000 (16:39 +1000)]
image: change Pix from []FooColor to []uint8.

Some benchmark numbers below. The image/draw fast-paths show dramatic
improvement, the generic slow-paths show a smaller slow-down.

BEFORE
png.BenchmarkEncodePaletted      200       8203800 ns/op      37.45 MB/s
png.BenchmarkEncodeRGBOpaque         100      26940440 ns/op      45.61 MB/s
png.BenchmarkEncodeRGBA       20      73821000 ns/op      16.65 MB/s
jpeg.BenchmarkEncodeRGBOpaque         50      35598640 ns/op      34.52 MB/s
draw.BenchmarkFillOver      500    4024226 ns/op
draw.BenchmarkFillSrc    10000     152736 ns/op
draw.BenchmarkCopyOver      500    3452824 ns/op
draw.BenchmarkCopySrc    50000      73218 ns/op
draw.BenchmarkNRGBAOver      500    3941234 ns/op
draw.BenchmarkNRGBASrc     1000    2484400 ns/op
draw.BenchmarkYCbCr     1000    2609005 ns/op
draw.BenchmarkGlyphOver     2000    1169575 ns/op
draw.BenchmarkRGBA      200    9031390 ns/op
draw.BenchmarkGenericOver       50   34636620 ns/op
draw.BenchmarkGenericMaskOver      100   16561150 ns/op
draw.BenchmarkGenericSrc      100   13873760 ns/op
draw.BenchmarkGenericMaskSrc      100   25198860 ns/op

AFTER
png.BenchmarkEncodePaletted      200       8206600 ns/op      37.43 MB/s
png.BenchmarkEncodeRGBOpaque         100      26129530 ns/op      47.03 MB/s
png.BenchmarkEncodeRGBA       20      75776750 ns/op      16.22 MB/s
jpeg.BenchmarkEncodeRGBOpaque         50      37192940 ns/op      33.04 MB/s
draw.BenchmarkFillOver      500    3008134 ns/op
draw.BenchmarkFillSrc    10000     154214 ns/op
draw.BenchmarkCopyOver     1000    2169988 ns/op
draw.BenchmarkCopySrc    50000      73095 ns/op
draw.BenchmarkNRGBAOver     1000    2491079 ns/op
draw.BenchmarkNRGBASrc     2000    1361244 ns/op
draw.BenchmarkYCbCr     1000    2554269 ns/op
draw.BenchmarkGlyphOver     2000    1042225 ns/op
draw.BenchmarkRGBA      100   10233340 ns/op
draw.BenchmarkGenericOver       50   38421560 ns/op
draw.BenchmarkGenericMaskOver      100   17521190 ns/op
draw.BenchmarkGenericSrc      100   16351200 ns/op
draw.BenchmarkGenericMaskSrc      100   26538190 ns/op

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

13 years agoimage/draw: add benchmarks.
Nigel Tao [Tue, 12 Jul 2011 06:17:02 +0000 (16:17 +1000)]
image/draw: add benchmarks.

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

13 years agodoc: document r58.1
Russ Cox [Tue, 12 Jul 2011 05:39:09 +0000 (01:39 -0400)]
doc: document r58.1

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

13 years agoruntime: eliminate false sharing on runtime.goidgen
Dmitriy Vyukov [Tue, 12 Jul 2011 05:25:14 +0000 (01:25 -0400)]
runtime: eliminate false sharing on runtime.goidgen
runtime.goidgen can be quite frequently modified and
shares cache line with the following variables,
it leads to false sharing.
50c6b0 b nfname
50c6b4 b nfunc
50c6b8 b nfunc$17
50c6bc b nhist$17
50c6c0 B runtime.checking
50c6c4 B runtime.gcwaiting
50c6c8 B runtime.goidgen
50c6cc B runtime.gomaxprocs
50c6d0 B runtime.panicking
50c6d4 B strconv.IntSize
50c6d8 B src/pkg/runtime/_xtest_.ss
50c6e0 B src/pkg/runtime/_xtest_.stop
50c6e8 b addrfree
50c6f0 b addrmem
50c6f8 b argv

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

13 years agoruntime: eliminate false sharing on random number generators
Dmitriy Vyukov [Tue, 12 Jul 2011 05:23:58 +0000 (01:23 -0400)]
runtime: eliminate false sharing on random number generators
Use machine-local random number generator instead of
racy global ones.

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

13 years agoruntime: fix data race on runtime·maxstring
Dmitriy Vyukov [Tue, 12 Jul 2011 05:21:06 +0000 (01:21 -0400)]
runtime: fix data race on runtime·maxstring
The data race can lead to erroneous output of
"[invalid string]" instead of a string.

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

13 years ago6l: change default output name to 6.out.exe on windows
Alex Brainman [Tue, 12 Jul 2011 04:22:48 +0000 (14:22 +1000)]
6l: change default output name to 6.out.exe on windows

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

13 years agohttp: support for periodic flushing in ReverseProxy
Brad Fitzpatrick [Tue, 12 Jul 2011 03:56:21 +0000 (20:56 -0700)]
http: support for periodic flushing in ReverseProxy

Fixes #2012

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

13 years agoexp/template: make numbers adhere to Go's rules for ideal constants.
Rob Pike [Tue, 12 Jul 2011 03:15:26 +0000 (13:15 +1000)]
exp/template: make numbers adhere to Go's rules for ideal constants.
Without further type informatnion, 1.0 is a float and an integer
must fit in an int.

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

13 years agogo/build: make Nuke comment say what it does
Alex Brainman [Tue, 12 Jul 2011 03:08:22 +0000 (13:08 +1000)]
go/build: make Nuke comment say what it does

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

13 years agocodereview: fix for Mercurial 1.9
Andrew Gerrand [Tue, 12 Jul 2011 02:58:40 +0000 (22:58 -0400)]
codereview: fix for Mercurial 1.9

R=golang-dev, mirtchovski, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4686049

13 years agodoc: don't specify make target for working on windwos.
Yasuhiro Matsumoto [Tue, 12 Jul 2011 00:02:32 +0000 (20:02 -0400)]
doc: don't specify make target for working on windwos.
makehtml does not work on windows.

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

13 years agoundo CL 4675045 / 0e11e08951f7
Andrew Gerrand [Mon, 11 Jul 2011 23:57:39 +0000 (09:57 +1000)]
undo CL 4675045 / 0e11e08951f7

Breaks Mercurial 1.8.3.

««« original CL description
codereview: fix for Mercurial 1.9

Fixes #2038.

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

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

13 years agocodereview: fix for Mercurial 1.9
Andrew Gerrand [Mon, 11 Jul 2011 23:36:46 +0000 (09:36 +1000)]
codereview: fix for Mercurial 1.9

Fixes #2038.

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

13 years agocgi: close stdout reader pipe when finished
Brad Fitzpatrick [Mon, 11 Jul 2011 22:59:27 +0000 (15:59 -0700)]
cgi: close stdout reader pipe when finished

This causes the child, if still writing, to get an error or
SIGPIPE and most likely exit so our subsequent wait can
finish.

A more guaranteed fix would be putting a time limit on the
child's overall execution, but this fixes the problem
I was having.

Fixes #2059

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

13 years agoos: don't permit Process.Signal after a successful Wait
Brad Fitzpatrick [Mon, 11 Jul 2011 22:47:42 +0000 (15:47 -0700)]
os: don't permit Process.Signal after a successful Wait

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

13 years agoexec: closeAfterWait append bug
Brad Fitzpatrick [Mon, 11 Jul 2011 21:46:46 +0000 (14:46 -0700)]
exec: closeAfterWait append bug

Wasn't actually eager closing the fds as a result of the
copy/paste bug. (GC was doing it instead)

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

13 years agojson: encode \r and \n in strings as e.g. "\n", not "\u000A"
Evan Martin [Mon, 11 Jul 2011 14:31:08 +0000 (07:31 -0700)]
json: encode \r and \n in strings as e.g. "\n", not "\u000A"

This is allowed by the JSON spec and is shorter/easier to read.

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

13 years agostrconv: handle [-+]Infinity in atof
Brad Fitzpatrick [Mon, 11 Jul 2011 14:25:45 +0000 (07:25 -0700)]
strconv: handle [-+]Infinity in atof

This is the form as returned by Postgres, as well
as JavaScript.

I've tried and failed to find authorative docs online
about the proper string serialization, if any.

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

13 years agoexp/template: fix bug in argument evaluation.
Rob Pike [Mon, 11 Jul 2011 08:06:24 +0000 (18:06 +1000)]
exp/template: fix bug in argument evaluation.
Must keep dot and the receiver separate - variables broke that symmetry.
Also clean up function invocation and rename "data" to "dot" for clarity.

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

13 years agogo/build: use os.MkdirAll to create directories
Alex Brainman [Mon, 11 Jul 2011 05:40:41 +0000 (15:40 +1000)]
go/build: use os.MkdirAll to create directories

Replaces "mkdir -p ..." command, as Windows mkdir command
does not support -p flag. Also, is simpler and faster then
launching new process.

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

13 years agoexp/template: fields and methods on variables.
Rob Pike [Mon, 11 Jul 2011 05:23:38 +0000 (15:23 +1000)]
exp/template: fields and methods on variables.
Not strictly necessary (you could achieve the same, clumsily,
via with blocks) but great to have: $x.Field, $y.Method.

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

13 years agoexp/template: documentation glitches and typos.
Rob Pike [Mon, 11 Jul 2011 04:43:21 +0000 (14:43 +1000)]
exp/template: documentation glitches and typos.
Also explain that len(v)==0 makes v a 'zero value'
in template execution.

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

13 years agoexp/template: simpler parse of char constants.
Rob Pike [Mon, 11 Jul 2011 02:36:10 +0000 (12:36 +1000)]
exp/template: simpler parse of char constants.
We can avoid the check against empty constants (''),
which UnquoteChar doesn't handle well, by leaving on
the trailing quote and seeing that's all we have left at the end.

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

13 years agoexp/template: character constants.
Rob Pike [Mon, 11 Jul 2011 01:46:22 +0000 (11:46 +1000)]
exp/template: character constants.
Easier to implement than to justify leaving them out.

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

13 years agoexp/template: static check for defined variables.
Rob Pike [Mon, 11 Jul 2011 00:01:15 +0000 (10:01 +1000)]
exp/template: static check for defined variables.
Worth catching at parse time rather than execution. Plus it's really easy.

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

13 years agoexp/eval: delete binary
Rob Pike [Sun, 10 Jul 2011 23:36:17 +0000 (09:36 +1000)]
exp/eval: delete binary
Mistakenly checked in.
Fixes #2058.

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

13 years agoflag: make -help nicer.
Rob Pike [Sun, 10 Jul 2011 23:35:50 +0000 (09:35 +1000)]
flag: make -help nicer.
- suppress the print that -help is not defined.
- return a special error code if -help is set
- do not change behavior if an explict "help" flag is defined.

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

13 years agoexp/template: add functions print and println.
Rob Pike [Sun, 10 Jul 2011 23:19:18 +0000 (09:19 +1000)]
exp/template: add functions print and println.

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

13 years agoexp/template: package documentation
Rob Pike [Sun, 10 Jul 2011 10:56:26 +0000 (20:56 +1000)]
exp/template: package documentation

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

13 years agoimage: change Pix[0] to mean top-left corner of an image's Rect instead
Nigel Tao [Sun, 10 Jul 2011 04:29:47 +0000 (14:29 +1000)]
image: change Pix[0] to mean top-left corner of an image's Rect instead
of the origin.

image/png and image/jpeg benchmarks show no significant changes.

The image/draw changes suggest to me that making a gofix for this is not
feasible. People are just going to have to make manual fixes.

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

13 years agoarchive/zip: add Writer
Andrew Gerrand [Sun, 10 Jul 2011 01:30:16 +0000 (11:30 +1000)]
archive/zip: add Writer

R=bradfitz, dchest, r, rsc
CC=golang-dev
https://golang.org/cl/4523077

13 years agomultipart: use textproto to handle multiline header
Evan Martin [Sat, 9 Jul 2011 22:18:31 +0000 (15:18 -0700)]
multipart: use textproto to handle multiline header

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

13 years agoCONTRIBUTORS: add Evan Martin (Google CLA)
Brad Fitzpatrick [Sat, 9 Jul 2011 22:18:18 +0000 (15:18 -0700)]
CONTRIBUTORS: add Evan Martin (Google CLA)

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

13 years agohttp: update triv.go with gofix
Andrew Balholm [Sat, 9 Jul 2011 22:10:39 +0000 (15:10 -0700)]
http: update triv.go with gofix

Sample code in triv.go wouldn't compile because it didn't use the new
FileSystem interface.
This was discussed on golang-nuts on July 7.
https://groups.google.com/forum/#!topic/golang-nuts/NMhZk3Ft_Vc

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

13 years agoexp/template: better template invocation
Rob Pike [Sat, 9 Jul 2011 21:32:01 +0000 (07:32 +1000)]
exp/template: better template invocation
1) Make the value optional ({{template "foo"}})
2) Allow the template identifier to be a thing of type *Template.
The second makes it easy to drop templates in to a set dynamically
during invocation.

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

13 years agotutorial: remove all line numbers and references to them.
Rob Pike [Sat, 9 Jul 2011 13:17:38 +0000 (23:17 +1000)]
tutorial: remove all line numbers and references to them.

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

13 years agodoc/progs: gofmt -w
Mikio Hara [Sat, 9 Jul 2011 10:16:45 +0000 (20:16 +1000)]
doc/progs: gofmt -w

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

13 years agoexp/template: vars as arguments to functions and methods.
Rob Pike [Sat, 9 Jul 2011 07:11:35 +0000 (17:11 +1000)]
exp/template: vars as arguments to functions and methods.
That should be it, bugs aside.

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

13 years agoexp/template: variable evaluation.
Rob Pike [Sat, 9 Jul 2011 02:05:39 +0000 (12:05 +1000)]
exp/template: variable evaluation.
Still need to do static checking of declarations during parse.

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

13 years agoexp/template: delete upward evaluation.
Rob Pike [Fri, 8 Jul 2011 22:59:56 +0000 (08:59 +1000)]
exp/template: delete upward evaluation.
It was an ill-advised carryover from the previous template package.
Also clean up function evaluation.
Also add a Name method to Template.

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

13 years agoexp/template: forgot to allow . as a function argument
Rob Pike [Fri, 8 Jul 2011 08:25:46 +0000 (18:25 +1000)]
exp/template: forgot to allow . as a function argument

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

13 years agoexp/template: parse variables and declarations
Rob Pike [Fri, 8 Jul 2011 07:54:16 +0000 (17:54 +1000)]
exp/template: parse variables and declarations

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

13 years agoexp/template: lex variables
Rob Pike [Fri, 8 Jul 2011 07:53:55 +0000 (17:53 +1000)]
exp/template: lex variables
Variables start with'$' and are declared with ':='.

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

13 years agoexp/template: add a tree-walking example to the test.
Rob Pike [Fri, 8 Jul 2011 06:49:06 +0000 (16:49 +1000)]
exp/template: add a tree-walking example to the test.
Also fix a comment formatting glitch.

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

13 years agoexp/template: the must-have MustParse functions
Andrew Gerrand [Fri, 8 Jul 2011 06:01:32 +0000 (16:01 +1000)]
exp/template: the must-have MustParse functions

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

13 years agoexp/template: allow fields and methods to be found in parent structs.
Rob Pike [Fri, 8 Jul 2011 05:22:05 +0000 (15:22 +1000)]
exp/template: allow fields and methods to be found in parent structs.

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

13 years agotag weekly.2011-07-07
Andrew Gerrand [Fri, 8 Jul 2011 03:30:49 +0000 (13:30 +1000)]
tag weekly.2011-07-07

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