Robert Griesemer
95117d30a2
time: typo in documentation
...
R=r
CC=golang-dev
https://golang.org/cl/4763048
2011-07-18 17:54:32 -07:00
Hector Chu
47e6042f73
runtime: fix select pass 3
...
Fixes #2075
R=rsc, ken, r
CC=golang-dev
https://golang.org/cl/4748045
2011-07-18 16:15:01 -04:00
Russ Cox
bd77619142
runtime: track running goroutine count
...
Used to use mcpu+msyscall but that's
problematic for packing into a single
atomic word. The running goroutine count
(where running == Go code or syscall)
can be maintained separately, always
manipulated under lock.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4767041
2011-07-18 15:50:55 -04:00
Dmitriy Vyukov
27753ff108
runtime: add per-M caches for MemStats
...
Avoid touching centralized state during
memory manager operations.
R=mirtchovski
CC=golang-dev, rsc
https://golang.org/cl/4766042
2011-07-18 14:56:22 -04:00
Dmitriy Vyukov
66d5c9b1e9
runtime: add per-M caches for MemStats
...
Avoid touching centralized state during
memory manager opreations.
R=rsc
CC=golang-dev
https://golang.org/cl/4766042
2011-07-18 14:52:57 -04:00
Ian Lance Taylor
257df1719d
debug/proc: Remove.
...
The package was always GNU/Linux specific, and is no longer
used by anything now that exp/ogle has been removed.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4757049
2011-07-18 09:55:09 -07:00
Dmitriy Vyukov
ee6e1a3ff7
sync: add fast paths to WaitGroup
...
benchmark old ns/op new ns/op delta
BenchmarkWaitGroupUncontended 93.50 33.60 -64.06%
BenchmarkWaitGroupUncontended-2 44.30 16.90 -61.85%
BenchmarkWaitGroupUncontended-4 21.80 8.47 -61.15%
BenchmarkWaitGroupUncontended-8 12.10 4.86 -59.83%
BenchmarkWaitGroupUncontended-16 7.38 3.35 -54.61%
BenchmarkWaitGroupAddDone 58.40 33.70 -42.29%
BenchmarkWaitGroupAddDone-2 293.00 85.80 -70.72%
BenchmarkWaitGroupAddDone-4 243.00 51.10 -78.97%
BenchmarkWaitGroupAddDone-8 236.00 52.20 -77.88%
BenchmarkWaitGroupAddDone-16 215.00 43.30 -79.86%
BenchmarkWaitGroupAddDoneWork 826.00 794.00 -3.87%
BenchmarkWaitGroupAddDoneWork-2 450.00 424.00 -5.78%
BenchmarkWaitGroupAddDoneWork-4 277.00 220.00 -20.58%
BenchmarkWaitGroupAddDoneWork-8 440.00 116.00 -73.64%
BenchmarkWaitGroupAddDoneWork-16 569.00 66.50 -88.31%
BenchmarkWaitGroupWait 29.00 8.04 -72.28%
BenchmarkWaitGroupWait-2 74.10 4.15 -94.40%
BenchmarkWaitGroupWait-4 117.00 2.30 -98.03%
BenchmarkWaitGroupWait-8 111.00 1.31 -98.82%
BenchmarkWaitGroupWait-16 104.00 1.27 -98.78%
BenchmarkWaitGroupWaitWork 802.00 792.00 -1.25%
BenchmarkWaitGroupWaitWork-2 411.00 401.00 -2.43%
BenchmarkWaitGroupWaitWork-4 210.00 199.00 -5.24%
BenchmarkWaitGroupWaitWork-8 206.00 105.00 -49.03%
BenchmarkWaitGroupWaitWork-16 334.00 54.40 -83.71%
R=rsc
CC=golang-dev
https://golang.org/cl/4672050
2011-07-18 12:35:55 -04:00
Russ Cox
92c6061b5c
5l: assume Linux binary, not Plan 9
...
R=bradfitz
CC=golang-dev
https://golang.org/cl/4767042
2011-07-18 12:30:10 -04:00
Brad Fitzpatrick
3745716bc3
http: let FileServer work when path doesn't begin with a slash
...
... as when it's over-stripped with StripPrefix.
R=golang-dev, andybalholm, rsc
CC=golang-dev
https://golang.org/cl/4759052
2011-07-18 09:04:48 -07:00
Russ Cox
caa5647408
ld: allow seek within write buffer
...
Reduces number of write+seek's from 88516 to 2080
when linking godoc with 6l.
Thanks to Alex Brainman for pointing out the
many small writes.
R=golang-dev, r, alex.brainman, robert.hencke
CC=golang-dev
https://golang.org/cl/4743043
2011-07-18 12:04:09 -04:00
Albert Strasheim
870fdd760a
syscall: Parse and encode SCM_RIGHTS and SCM_CREDENTIALS.
...
R=rsc, agl, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4667066
2011-07-18 11:21:59 -04:00
Dmitriy Vyukov
c1f035ba4c
runtime: fix data race in Plan9 sysalloc
...
Add mutex to protect brk limit.
Add mstats.sys update.
R=rsc
CC=golang-dev
https://golang.org/cl/4762045
2011-07-18 10:50:04 -04:00
Brad Fitzpatrick
e8689404a7
cgo: add missing semicolon in generated struct
...
This affected certain signatures needing padding
like:
//export Foo
func Foo() (int, C.long) { ... }
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4745047
2011-07-18 07:23:52 -07:00
Dave Cheney
c945d9c8a1
gc: fix silent sign truncation in pgen.c
...
Fixes #2076 .
R=golang-dev, r, r, dsymonds, lucio.dere
CC=golang-dev
https://golang.org/cl/4744047
2011-07-18 21:09:28 +10:00
Rob Pike
9a5bb287e8
exp/template: dig into empty interfaces so a struct (say) stored in an empty
...
interface field can be unpacked. We don't have type assertions here so we
must be forthright.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4757047
2011-07-18 17:34:42 +10:00
Andrew Gerrand
ab55133ca9
doc: fix padding on h1 tags
...
See /doc/codewalk/sharemem/ for an example of how it's broken.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4742044
2011-07-18 17:30:00 +10:00
Alex Brainman
3c4ca95da9
path/filepath: fixes for windows paths
...
- Clean and IsAbs to handle paths with drive letter properly.
- Clean to replace / with \.
R=golang-dev, adg
CC=golang-dev, mattn.jp
https://golang.org/cl/4758051
2011-07-18 17:08:12 +10:00
Nigel Tao
95323c59ea
runtime: fix panic for make(chan [0]byte).
...
I suspect that this was introduced by
http://code.google.com/p/go/source/detail?r=6e4ee32fffd1
R=r
CC=golang-dev
https://golang.org/cl/4764045
2011-07-18 15:54:11 +10:00
David Symonds
a8e0035bd3
http: drain the pipe output in TestHandlerPanic to avoid logging deadlock.
...
R=r
CC=golang-dev
https://golang.org/cl/4756047
2011-07-18 12:59:16 +10:00
Rob Pike
08e47ebb7d
fmt: fix a couple of documentation glitches.
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4758050
2011-07-18 11:44:27 +10:00
Rob Pike
50d90451ff
reflect: panic if Method index is out of range for a type.
...
Makes the code agree with the documentation.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4759050
2011-07-18 11:34:13 +10:00
Rob Pike
9d55c282e3
5c: attempt to fix build by silencing warnings about unused variables.
...
The story is more complicated; this is just a bandaid.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4755047
2011-07-18 11:08:55 +10:00
Quan Yong Zhai
cb051a3a1d
gob: minor cleanup
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4754050
2011-07-18 10:48:31 +10:00
Rob Pike
f189308fb4
fmt: Scan(&int) was mishandling a lone zero.
...
It took it as an octal base prefix but assumed more digits were coming.
Fixes #2077 .
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4764044
2011-07-18 10:05:35 +10:00
Lucio De Re
8c5c3c504c
cmd/5l/Makefile: directory prefix nit, "../5l/" is not needed.
...
R=golang-dev, r
CC=golang-dev, rsc
https://golang.org/cl/4755046
2011-07-18 08:46:47 +10:00
Brad Fitzpatrick
8b33c7b5be
http: make tests quiet, fixing a test race
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4754044
2011-07-17 15:46:10 -07:00
Brad Fitzpatrick
6075206904
log: more locking
...
This didn't actually cause a bug, but looks wrong.
There was a lock but there was more shared mutable state not
guarded by it.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4760047
2011-07-17 15:46:00 -07:00
Rob Pike
c705701c69
exp/templates: variable scope persists until "end".
...
The previous CL doicumented and diagnosed the old situation.
This one changes it to something more traditional: any action
may declare a variable, and the block structure of scopes
applies only to control seequences.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4748047
2011-07-17 13:31:59 +10:00
Rob Pike
331840f509
exp/template: allow declaration of variables only inside control structures.
...
In simple pipelines the declaration has no scope.
Also document the scope.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4761044
2011-07-17 12:32:00 +10:00
Russ Cox
e07c6e6ee7
http: fixes for sniffing
...
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4753044
2011-07-15 12:07:37 -04:00
Lucio De Re
4c6280b0f1
6a, 6c, 6l: fix for Plan 9 build
...
6a/a.h:
. Dropped <u.h> and <libc.h>.
. Made definition of EOF conditional.
6a/a.y:
. Added <u.h> and <libc.h>.
6a/lex.c:
. Added <u.h> and <libc.h>.
. Dropped <ctype.h> (now in <u.h>).
6c/gc.h:
. Added varargck pragma for "lD".
6c/swt.c:
. Dropped unused "thestring" argument in Bprint() calls.
6l/Makefile:
. Dropped unneeded directory prefix.
6l/l.h:
. Dropped unneeded directory prefix.
. Added varargck pragma for "I" and "i".
6l/obj.c:
. Dropped unneeded assignment.
. Dropped unreachable goto statement.
6l/pass.c:
. Dropped assignments flagged as unused.
6l/prof.c:
. Replaced "#if 0" with "#ifdef NOTDEF".
6l/span.c:
. Dropped unused incrementation.
. Added USED() as required.
. Dropped unreachable "return" statement.
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4747044
2011-07-15 11:58:39 -04:00
Lucio De Re
5ea4d73b17
5a, 5c, 5l: fix for Plan 9 build
...
5a/a.h:
. Removed <u.h> and <lib.h>.
. Made definition of EOF conditional.
5a/a.y:
. Added <u.h> and <lib.h>.
5a/lex.c:
. Added <u.h> and <lib.h>.
. Dropped <ctype.h> (now in <u.h>).
5c/peep.c:
. Removed unnecessary "return 0" statement.
5c/reg.c:
. Added compilation condition around unused code.
5c/swt.c:
. Removed unused "thestring" argument from Bprint() calls.
5l/asm.c:
. Added USED() statements as required.
. Adjusted a few format specifications.
. Added compilation condition around unused code.
5l/l.h:
. Dropped directory prefix from <../5l/5.out.h>.
. Added varargck pragma for "I" and "i".
5l/obj.c:
. Cascaded consecutive "if" statements.
. Dropped unnecessary incrementation and assignments.
5l/pass.c:
. Dropped unnecessary assignment.
5l/prof.c:
. #if 0 converted to #ifdef NOTDEF.
5l/span.c:
. Dropped unnecessary incrementation and assignments.
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4752041
2011-07-15 11:58:28 -04:00
Lucio De Re
0490eb60bb
8l: nits
...
8l/Makefile:
. Dropped unnecessary prefix from "../8l/8.out.h"
8l/l.h:
. Dropped unnecessary prefix from "../8l/8.out.h"
. Dropped unused and inconsistent "I" vararg pragma.
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4754041
2011-07-15 11:51:59 -04:00
Dmitriy Vyukov
491aa1579d
runtime: native xadd for 386/amd64
...
benchmark old ns/op new ns/op delta
BenchmarkSemaUncontended 37.40 34.10 -8.82%
BenchmarkSemaUncontended-2 18.90 17.70 -6.35%
BenchmarkSemaUncontended-4 11.90 10.90 -8.40%
BenchmarkSemaUncontended-8 6.26 5.19 -17.09%
BenchmarkSemaUncontended-16 4.39 3.91 -10.93%
BenchmarkSemaSyntNonblock 38.00 35.30 -7.11%
BenchmarkSemaSyntNonblock-2 83.00 46.70 -43.73%
BenchmarkSemaSyntNonblock-4 124.00 101.00 -18.55%
BenchmarkSemaSyntNonblock-8 124.00 116.00 -6.45%
BenchmarkSemaSyntNonblock-16 148.00 114.00 -22.97%
(on HP Z600 2 x Xeon E5620, 8 HT cores, 2.40GHz)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4755041
2011-07-15 11:27:16 -04:00
Luuk van Dijk
8cf8806d31
gc: some enhancements to printing debug info.
...
R=rsc
CC=golang-dev
https://golang.org/cl/4710046
2011-07-15 16:00:05 +02:00
Russ Cox
e1b2e20217
http: sniffing placeholder
...
R=dsymonds
CC=golang-dev
https://golang.org/cl/4746041
2011-07-15 01:01:49 -04:00
Andrew Gerrand
5d929a9c92
go/build: less aggressive failure when GOROOT not found
...
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4743041
2011-07-15 13:45:22 +10:00
Russ Cox
29125be5c7
runtime: make TestSideEffectOrder work twice
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4714045
2011-07-14 23:43:03 -04:00
Brad Fitzpatrick
fc7b42325a
cgi: make test less flaky
...
Previously, during the anti-zombie test, a
CGI process had to finish within ~625ms.
Now it gets ~5.6 seconds.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4741041
2011-07-14 17:00:14 -07:00
Robert Griesemer
48f598a393
go/printer: simplify internal state
...
No formatting changes.
R=rsc
CC=golang-dev
https://golang.org/cl/4735042
2011-07-14 16:09:15 -07:00
Robert Griesemer
38a53c7ecb
go spec: (up-)date
...
R=rsc, bradfitz, r
CC=golang-dev
https://golang.org/cl/4738042
2011-07-14 15:58:37 -07:00
Robert Griesemer
90564a9256
go/printer: changed max. number of newlines from 3 to 2
...
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src
runs all tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Russ Cox
58e19aa4cb
go: require { } around else block
...
R=gri, ken, r
CC=golang-dev
https://golang.org/cl/4721044
2011-07-14 17:15:52 -04:00
Brad Fitzpatrick
3f53475c97
json: add omitempty struct tag option
...
Fixes #2032
R=rsc, dsymonds, r, r
CC=golang-dev
https://golang.org/cl/4709044
2011-07-14 11:54:55 -07:00
Robert Griesemer
8d73781f8b
godoc: fix build (add Makefile change)
...
R=bradfitz
CC=golang-dev
https://golang.org/cl/4733041
2011-07-14 11:48:23 -07:00
Robert Griesemer
df68a61c9e
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
2011-07-14 11:34:53 -07:00
Luuk van Dijk
e8ff9a624f
gc: fix closure bug
...
Fixes #2056 .
R=rsc
CC=golang-dev
https://golang.org/cl/4709042
2011-07-14 18:13:39 +02:00
David Symonds
cbad580e9c
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
2011-07-14 13:30:08 +10:00
Rob Pike
fc1f0bd5e9
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
2011-07-14 13:15:55 +10:00
Russ Cox
aec89c4c40
mime: fix build
...
R=bradfitz
CC=golang-dev
https://golang.org/cl/4695060
2011-07-13 20:04:12 -07:00