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

7601 Commits

Author SHA1 Message Date
Brad Fitzpatrick
9733f96b47 http: initialize request Header for the transport
Fixes #1558

R=rsc, r, bradfitzwork
CC=golang-dev
https://golang.org/cl/4260042
2011-03-02 10:21:56 -08:00
David Symonds
1d258a554a http: give ParseHTTPVersion a real example.
R=rsc
CC=golang-dev
https://golang.org/cl/4239050
2011-03-02 10:10:12 +11:00
Brad Fitzpatrick
60f193781d http: expose Client's Transport
This is again an intentionally minimal change.

The plan is to keep Client's zero value be a usable
client, with optional fields being added over time
(e.g. cookie manager, redirect policy, auth)

R=rsc
CC=golang-dev
https://golang.org/cl/4239044
2011-03-01 14:07:28 -08:00
Rob Pike
966bf71366 docs: make "runtime" a word only as a name for the package.
Computer people have an agglutinating streak that I like to resist.
As a time of execution: run time.
As an adjective: run-time.
As a noun: run-time support/code/library.

Signed,
Mr. Pedant.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4252048
2011-03-01 13:54:22 -08:00
Rob Pike
a77744f488 fmt: delete debugging print that crept in to test.
(you'd never see it, but ouch.)
Spotted by Florian Weimer.

R=rsc
CC=golang-dev
https://golang.org/cl/4259044
2011-03-01 13:39:44 -08:00
Rob Pike
2b9ab22732 fmt: make %#p suppress leading 0x
Fixes bug 1567.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4245048
2011-03-01 13:25:52 -08:00
David Symonds
7eaecb8915 http: export parseHTTPVersion.
R=rsc, adg
CC=golang-dev
https://golang.org/cl/4244045
2011-03-01 22:38:18 +11:00
Andrew Gerrand
4b0ecd3f49 doc: add FAQ about large binaries and stack vs heap allocation
doc: add internationalization to roadmap

R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/4251047
2011-03-01 21:35:46 +11:00
Rob Pike
41a23ca08b goyacc: clarify it's package, not binary, that has
conflict and explain that you could put the grammars
in separate packages instead.

I could be talked into rolling back the previous change
and just making a doc change instead, but I'm content
to let it stand.

R=rsc
CC=golang-dev
https://golang.org/cl/4240053
2011-02-28 20:47:52 -08:00
Rob Pike
bb0e7bda35 goyacc: provide -p flag to set prefix for names.
This should allow multiple goyacc grammars to be
compiled into the same binary. There's a chance it
Fixes #1562.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4256044
2011-02-28 17:43:16 -08:00
Dave Cheney
432b4f309b build: convert src/cmd to use make directly and simplify src/make.bash
R=adg, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4221047
2011-03-01 09:20:32 +11:00
Russ Cox
7da86983a8 gc: bug325 / issue 1566
Fixes #1566.

R=ken2
CC=golang-dev
https://golang.org/cl/4259041
2011-02-28 17:16:44 -05:00
Russ Cox
a3ef19825c build: move $GOBIN ahead of /bin, /usr/bin in build $PATH
Otherwise if there is an installed /usr/bin/6g the build
will use that one instead of the one it builds.

R=r
CC=golang-dev
https://golang.org/cl/4249045
2011-02-28 14:55:27 -05:00
Chris Dollin
b00f7310f3 xml: permit nested directives
Return <!DOCTYPE ...> with nested directives as one big token.

Fixes #1549.

R=niemeyer, rsc
CC=golang-dev
https://golang.org/cl/4216050
2011-02-28 14:09:04 -05:00
Rob Pike
b2efedbf36 template: document the delimiters better
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4248047
2011-02-28 10:27:33 -08:00
Mikio Hara
dd51f3537f syscall: regenerate zerrors_freebsd_amd64.go
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4248043
2011-02-28 10:21:19 -05:00
Russ Cox
582fd17e11 runtime: idle goroutine
This functionality might be used in environments
where programs are limited to a single thread,
to simulate a select-driven network server.  It is
not exposed via the standard runtime API.

R=r, r2
CC=golang-dev
https://golang.org/cl/4254041
2011-02-27 23:32:42 -05:00
Nigel Tao
fdbbb066ed compress/lzw: don't use a closure in NewReader, which avoids having
to move some variables from the stack to the heap.

Sorted benchmark runs on my 2007-era Mac Mini (GOARCH=amd64, GOOS=linux):

Before:
lzw.BenchmarkDecoder        2000        878176 ns/op
lzw.BenchmarkDecoder        2000        878415 ns/op
lzw.BenchmarkDecoder        2000        880352 ns/op
lzw.BenchmarkDecoder        2000        898445 ns/op
lzw.BenchmarkDecoder        2000        901728 ns/op

After:
lzw.BenchmarkDecoder        2000        859065 ns/op
lzw.BenchmarkDecoder        2000        859402 ns/op
lzw.BenchmarkDecoder        2000        860035 ns/op
lzw.BenchmarkDecoder        2000        860555 ns/op
lzw.BenchmarkDecoder        2000        861109 ns/op

The ratio of before/after median times is 1.024.

The runtime.MemStats.Mallocs delta per loop drops from 109 to 104.

R=r, r2, dfc
CC=golang-dev
https://golang.org/cl/4253043
2011-02-26 16:42:49 +11:00
Nigel Tao
5b1d47d105 compress/lzw: fix the stupidity of allocating and zeroing a new buffer
on each loop iteration, yielding a 20x performance improvement.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4240044
2011-02-26 09:25:29 +11:00
Rob Pike
54f0040723 crypto/openpgp: fix test prints
R=agl, agl1
CC=golang-dev
https://golang.org/cl/4255041
2011-02-25 13:44:37 -08:00
Russ Cox
d1cd829405 runtime: omit breakpoint during terminal panic
again.
CL 4222043 missed this case.

R=brainman, r, r2
CC=golang-dev
https://golang.org/cl/4235043
2011-02-25 15:17:34 -05:00
Russ Cox
c833d2fd94 sync/atomic: make BUG comment godoc-compatible
go/doc wants to see text after BUG(uid): on the same line
in order to treat it as an official bug comment.

R=gri
CC=golang-dev
https://golang.org/cl/4250043
2011-02-25 14:40:36 -05:00
Russ Cox
9ad9742157 runtime: use kernel-supplied cas on linux/arm
Using the kernel-supplied compare-and-swap code
on linux/arm means that runtime doesn't have to care
whether this is GOARM=5 or GOARM=6 anymore.

Fixes #1494.

R=r, r2
CC=golang-dev
https://golang.org/cl/4245043
2011-02-25 14:29:55 -05:00
Russ Cox
12b7875bf2 sync: use sync/atomic
Remove references to custom assembly routines.

R=r, r2
CC=golang-dev
https://golang.org/cl/4241043
2011-02-25 14:29:47 -05:00
Russ Cox
22eab1f5c7 sync/atomic: new package
Fixes #170.

R=gri, iant, r, r2
CC=golang-dev
https://golang.org/cl/4241041
2011-02-25 14:29:36 -05:00
Russ Cox
64f9e5a120 A+C: Chris Dollin (individual CLA)
R=r, r2, gri
CC=ehog.hedge, golang-dev
https://golang.org/cl/4240043
2011-02-25 14:05:44 -05:00
Rob Pike
c54b5d032f gob: make recursive map and slice types work.
Before this fix, types such as
        type T map[string]T
caused infinite recursion in the gob implementation.
Now they just work.

Fixes #1518.

R=rsc
CC=golang-dev
https://golang.org/cl/4230045
2011-02-25 09:45:06 -08:00
Russ Cox
895631770a 8a, 8l: add CMPXCHG8B, XADDB, XADDL, XADDW
R=ken2
CC=golang-dev
https://golang.org/cl/4240041
2011-02-25 01:04:29 -05:00
Russ Cox
96c785de39 5a, 5l: add LDREXD, STREXD
R=ken2
CC=golang-dev
https://golang.org/cl/4239041
2011-02-25 01:03:54 -05:00
Robert Griesemer
ad8b0d915b bug324.go: test case for issue 1550
Also: renamed fixedbugs/bug322.go to fixedbugs/bug323.go
because we already have a bugs/bug322.go and bug322.dir.

R=rsc
CC=golang-dev
https://golang.org/cl/4219044
2011-02-24 19:29:25 -08:00
Andrew Gerrand
cdf1c4f6e0 tag release.2011-02-24
R=rsc
CC=golang-dev
https://golang.org/cl/4231045
2011-02-25 14:24:08 +11:00
Andrew Gerrand
625bcf9f16 release.2011-02-24
R=r, rsc
CC=golang-dev
https://golang.org/cl/4213044
2011-02-25 14:13:14 +11:00
Adam Langley
6ca009f58d crypto/openpgp: add package
R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3989052
2011-02-24 20:19:53 -05:00
Robert Griesemer
27ccb41c4a godoc: accept symbolic links as path names provided to -path
When providing addition file systems to godoc via -path, the
path names may be symbolic links. Follow them.

Also: better logging of error and special conditions.

R=r, dsymonds, r2
CC=golang-dev
https://golang.org/cl/4217045
2011-02-24 16:24:51 -08:00
Alex Brainman
176eb49d9c runtime: add empty windows/signals.h file to fix build
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4223049
2011-02-25 11:16:39 +11:00
Nigel Tao
741eab4eb6 compress/lzw: implement an encoder.
R=rsc, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4209043
2011-02-25 09:20:04 +11:00
Russ Cox
8d36a78440 reflect: add pointer word to CommonType
The pointer will eventually let us find *T given T.
This CL just makes room for it, always storing a zero.

R=r, r2
CC=golang-dev
https://golang.org/cl/4221046
2011-02-24 17:11:20 -05:00
Russ Cox
820dc9ff1a runtime: fix signal stack bug
In CL 4188061 I changed malg to allocate the requested
number of bytes n, not n+StackGuard, so that the
allocations would use rounder numbers.

The allocation of the signal stack asks for 32k and
then used g->stackguard as the base, but g->stackguard
is StackGuard bytes above the base.  Previously, asking
for 32k meant getting 32k+StackGuard bytes, so using
g->stackguard as the base was safe.  Now, the actual base
must be computed, so that the signal handler does not
run StackGuard bytes past the top of the stack.

Was causing flakiness mainly in programs that use the
network, because they sometimes write to closed network
connections, causing SIGPIPEs.  Was also causing problems
in the doc/progs test.

Also fix Makefile so that changes to stack.h trigger rebuild.

R=bradfitzgo, r, r2
CC=golang-dev
https://golang.org/cl/4230044
2011-02-24 13:46:44 -08:00
Russ Cox
d94bf76239 ld: weak symbols
A reference to the address of weak.foo resolves at link time
to the address of the symbol foo if foo would end up in the
binary anyway, or to zero if foo would not be in the binary.

For example:

        int xxx = 1;
        int yyy = 2;
        int weak·xxx;
        int weak·yyy;

        void main·main(void) {
                runtime·printf("%p %p %p\n", &xxx, &weak·xxx, &weak·yyy);
        }

prints the same non-nil address twice, then 0 (because yyy is not
referenced so it was dropped from the binary).

This will be used by the reflection tables.

R=iant
CC=golang-dev
https://golang.org/cl/4223044
2011-02-24 16:45:45 -05:00
Russ Cox
4185a9e2b2 http: remove debugging log statement
Issue 1547 is fixed.

R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4209045
2011-02-24 14:36:18 -05:00
Robert Griesemer
c9021a1afe godoc: fix writeFileAtomically utility function
If the filename was absolute, writeFileAtomically
used the wrong filename for ioutil.TempFile leading
to non-existent directories and the TempFile would
fail.

R=r, r2
CC=golang-dev
https://golang.org/cl/4224043
2011-02-24 11:13:20 -08:00
Robert Griesemer
11bda7df47 godoc: log errors when reading filter files
R=r, r2
CC=golang-dev
https://golang.org/cl/4230042
2011-02-24 10:22:32 -08:00
Rob Pike
87fe958a49 fmt: stop giving characters to the Scan method of Scanner
when we hit a newline during *scanln routines.

Fixes #1490.

R=rsc
CC=golang-dev
https://golang.org/cl/4209042
2011-02-24 10:14:19 -08:00
Alex Brainman
75fb2f6c82 8l/6l: new -Hwindowsgui flag allows to build windows gui pe
Fixes #1516.

R=rsc, mattn
CC=golang-dev
https://golang.org/cl/4214041
2011-02-24 16:10:30 +11:00
Dave Cheney
a1d95deaaa build: remove unused nacl conditional from make.bash
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4217042
2011-02-24 15:56:53 +11:00
Alex Brainman
162d510d7e net: *netFD.Read to return os.EOF on eof (fixes windows build)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4210041
2011-02-24 10:17:45 +11:00
Brad Fitzpatrick
c7978584c3 http: set method GET on Get() requests
R=adg, bradfitzwork
CC=golang-dev
https://golang.org/cl/4229042
2011-02-23 15:03:30 -08:00
Russ Cox
8b8d5e9e00 build: remove _gcc_main.c during make clean
R=r, r2
CC=golang-dev
https://golang.org/cl/4226043
2011-02-23 15:51:27 -05:00
Russ Cox
b5dfac45ba runtime: always run stackalloc on scheduler stack
Avoids deadlocks like the one below, in which a stack split happened
in order to call lock(&stacks), but then the stack unsplit cannot run
because stacks is now locked.

The only code calling stackalloc that wasn't on a scheduler
stack already was malg, which creates a new goroutine.

runtime.futex+0x23 /home/rsc/g/go/src/pkg/runtime/linux/amd64/sys.s:139
       runtime.futex()
futexsleep+0x50 /home/rsc/g/go/src/pkg/runtime/linux/thread.c:51
       futexsleep(0x5b0188, 0x300000003, 0x100020000, 0x4159e2)
futexlock+0x85 /home/rsc/g/go/src/pkg/runtime/linux/thread.c:119
       futexlock(0x5b0188, 0x5b0188)
runtime.lock+0x56 /home/rsc/g/go/src/pkg/runtime/linux/thread.c:158
       runtime.lock(0x5b0188, 0x7f0d27b4a000)
runtime.stackfree+0x4d /home/rsc/g/go/src/pkg/runtime/malloc.goc:336
       runtime.stackfree(0x7f0d27b4a000, 0x1000, 0x8, 0x7fff37e1e218)
runtime.oldstack+0xa6 /home/rsc/g/go/src/pkg/runtime/proc.c:705
       runtime.oldstack()
runtime.lessstack+0x22 /home/rsc/g/go/src/pkg/runtime/amd64/asm.s:224
       runtime.lessstack()
----- lessstack called from goroutine 2 -----
runtime.lock+0x56 /home/rsc/g/go/src/pkg/runtime/linux/thread.c:158
       runtime.lock(0x5b0188, 0x40a5e2)
runtime.stackalloc+0x55 /home/rsc/g/go/src/pkg/runtime/malloc.c:316
       runtime.stackalloc(0x1000, 0x4055b0)
runtime.malg+0x3d /home/rsc/g/go/src/pkg/runtime/proc.c:803
       runtime.malg(0x1000, 0x40add9)
runtime.newproc1+0x12b /home/rsc/g/go/src/pkg/runtime/proc.c:854
       runtime.newproc1(0xf840027440, 0x7f0d27b49230, 0x0, 0x49f238, 0x40, ...)
runtime.newproc+0x2f /home/rsc/g/go/src/pkg/runtime/proc.c:831
       runtime.newproc(0x0, 0xf840027440, 0xf800000010, 0x44b059)
...

R=r, r2
CC=golang-dev
https://golang.org/cl/4216045
2011-02-23 15:51:20 -05:00
Russ Cox
59ce067da8 runtime: omit breakpoint during terminal panic
A terminal panic (one that prints a stack trace and exits)
has been calling runtime.breakpoint before calling exit,
so that if running under a debugger, the debugger can
take control.  When not running under a debugger, though,
this causes an additional SIGTRAP on Unix and pop-up
dialogs on Windows.

Support for debugging Go programs has gotten good
enough that we can rely on the debugger to set its own
breakpoint on runtime.exit if it wants to look around.

R=r, r2
CC=golang-dev
https://golang.org/cl/4222043
2011-02-23 15:42:13 -05:00