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

5366 Commits

Author SHA1 Message Date
Robert Griesemer
7e3d98bc9c gofmt: exclude testcase with incorrect syntax
R=r, r2
CC=golang-dev
https://golang.org/cl/4160047
2011-02-11 16:24:35 -08:00
Rob Pike
a67292f20f strconv/ftoa: avoid a double shift. (shifts by variables are expensive.)
R=rsc, gri, r2
CC=golang-dev
https://golang.org/cl/4169048
2011-02-11 16:06:04 -08:00
Russ Cox
a93c994bcf testing: include elapsed time in output
R=r
CC=golang-dev
https://golang.org/cl/4180045
2011-02-11 18:00:58 -05:00
Lorenzo Stoakes
b57ac97c27 gc: correct receiver in method missing error
Fixes #1324.

R=rsc1, r, rsc
CC=golang-dev
https://golang.org/cl/3435042
2011-02-11 17:47:58 -05:00
Russ Cox
26880d7e03 sync: check Unlock of unlocked Mutex
R=r, adg
CC=golang-dev
https://golang.org/cl/4180044
2011-02-11 17:47:17 -05:00
Ken Thompson
ca5179d3f6 5ld: stoped generating 64-bit eor
R=rsc
CC=golang-dev
https://golang.org/cl/4182049
2011-02-11 13:22:35 -08:00
Mikio Hara
9b85d499af syscall: remove obsolete socket IO control
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4183046
2011-02-11 16:20:31 -05:00
Petar Maymounkov
3de98466c8 http: add pipelining to ClientConn, ServerConn
R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4082044
2011-02-11 15:05:47 -05:00
Mikio Hara
9c97af99bc syscall: add sockaddr_dl, sysctl with routing message support for darwin, freebsd
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4171043
2011-02-11 14:34:00 -05:00
Russ Cox
48535ae3f1 runtime: check that SysReserve returns aligned memory
R=iant, iant2
CC=golang-dev
https://golang.org/cl/4180043
2011-02-11 14:32:34 -05:00
Yuval Pavel Zholkover
7e77623120 8l, runtime: place G and M pointers relative to _tos on Plan 9, instead of hardcoded values for USTKTOP.
This should allow executing both on native Plan 9 and inside 9vx.

R=rsc
CC=golang-dev
https://golang.org/cl/3993044
2011-02-11 13:39:05 -05:00
Evan Shaw
bbfad5f1cc bytes: fix bugs in buffer.ReadBytes
Fixes #1498.

R=golang-dev, mattn, r, rsc
CC=golang-dev
https://golang.org/cl/4140041
2011-02-11 12:39:18 -05:00
Adam Langley
4ee90b764e crypto/openpgp: minor updates to subpackages
Now that packet/ is checked in, we can add its Makefile. Also, a couple
of updates to error/ and s2k/ for bugfixes and to use the new crypto
package.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4179043
2011-02-11 08:34:19 -05:00
Mathieu Lonjaret
047b023119 fix example in inotify
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4174045
2011-02-11 08:30:34 -05:00
Luuk van Dijk
37b1787392 flag: allow hexadecimal and octal input for integer flags.
R=r
CC=golang-dev
https://golang.org/cl/4182043
2011-02-11 12:23:54 +01:00
Adam Langley
28a2369414 crypto/openpgp/packet: add remainder of packet types.
(The unittest for Signature may seem a little small, but it's tested by
the higher level code.)

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4173043
2011-02-10 19:59:12 -05:00
Robert Griesemer
a75e5fc670 godoc: godoc: Use IsAbs to test for absolute paths (fix for win32).
One more case.

R=r, r2
CC=golang-dev
https://golang.org/cl/4170044
2011-02-10 16:32:51 -08:00
Yasuhiro Matsumoto
3b3568ba49 godoc: Use IsAbs to test for absolute paths (fix for win32).
R=gri
CC=golang-dev
https://golang.org/cl/4129046
2011-02-10 16:00:24 -08:00
Alex Brainman
cf75c86cdf syscall: change windows apis with bool return value to return errno instead
This change is to make these apis similar to their unix counterparts.

R=rsc
CC=golang-dev
https://golang.org/cl/4185042
2011-02-11 10:15:51 +11:00
Brad Fitzpatrick
876e9d1b89 http: add Server type supporting timeouts
R=rsc
CC=golang-dev
https://golang.org/cl/4172041
2011-02-10 14:36:22 -08:00
Russ Cox
12bdb29bdf runtime: complete windows SysReserve
Should fix windows/386 build.

R=brainman
CC=golang-dev
https://golang.org/cl/4170041
2011-02-10 15:39:08 -05:00
Andrew Gerrand
4774a19530 encoding/binary: update package doc string to be more comprehensive
R=r
CC=golang-dev
https://golang.org/cl/4128060
2011-02-11 06:56:31 +11:00
Roger Peppe
b935728a17 fmt: fix minor typo
R=r, r2
CC=golang-dev
https://golang.org/cl/4187041
2011-02-10 11:01:05 -08:00
Andrew Gerrand
047cf3161e json: correct Marshal documentation
Fixes #1488.

R=r, rsc, rog
CC=golang-dev
https://golang.org/cl/4168043
2011-02-10 13:48:14 -05:00
Wei Guangjing
44bcc1fcd9 debug/pe: ImportedSymbols fixes
R=golang-dev, brainman, mattn, rsc
CC=golang-dev
https://golang.org/cl/4001058
2011-02-10 10:22:32 -05:00
Adam Langley
9fe490ee38 crypto/openpgp/packet: four more packet types.
R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4156044
2011-02-10 07:56:30 -05:00
Hector Chu
239ef63bf2 runtime: take the callback return value from the stack
R=brainman, lxn, rsc
CC=golang-dev
https://golang.org/cl/4126056
2011-02-10 23:02:27 +11:00
Rob Pike
34fc17a820 src/*: fix incorrect prints found by govet
R=gri
CC=golang-dev
https://golang.org/cl/4169044
2011-02-09 17:11:01 -08:00
Ken Thompson
cc4d57abac peep: more bugs
R=r
CC=golang-dev
https://golang.org/cl/4176042
2011-02-09 16:03:02 -08:00
Robert Griesemer
4438f50293 buffer.go: minor optimization, expanded comment
R=r
CC=golang-dev
https://golang.org/cl/4169043
2011-02-09 15:09:08 -08:00
Robert Griesemer
334f52ac49 godoc: optimizations: don't call Write for 0-length data
- guard some calls to Write that frequently may have 0-length data
- fix an invariant

R=r
CC=golang-dev
https://golang.org/cl/4179041
2011-02-09 15:06:05 -08:00
Rob Pike
fb9e37cd9b template: reverse order of arguments to Execute
In line with other functions such as Fprintf, put the
thing to be written first.

Apologies for the breakages this is sure to cause.

R=rsc, gri, adg, eds, r2, aam
CC=golang-dev
https://golang.org/cl/4169042
2011-02-09 14:23:01 -08:00
Ken Thompson
acc82ad721 peep: bug fix
R=r
CC=golang-dev
https://golang.org/cl/4173041
2011-02-09 13:13:17 -08:00
Rob Pike
6c03b0d468 run.bash: must make codelab before we can test it.
this will break the build, but it's already silently broken.

R=rsc
CC=golang-dev
https://golang.org/cl/4168041
2011-02-09 12:46:49 -08:00
Russ Cox
1cc8c87dc1 runtime: fix memory allocation on 386
BSD and Darwin require an extra page between
end and the first mapping, and Windows has various
memory in the way too.

Fixes #1464.

R=r, r2
CC=golang-dev
https://golang.org/cl/4167041
2011-02-09 15:08:30 -05:00
Russ Cox
5b1b2ba9c7 runtime: new allocation strategy for amd64
Do not reserve virtual address space.
Instead, assume it will be there when we need it,
and crash loudly if that assumption is violated.
Reserving the address space gets charged to
ulimit -v, which exceeds commonly set limits.

http://groups.google.com/group/golang-dev/msg/7c477af5f5a8dd2c

R=r, niemeyer
CC=golang-dev
https://golang.org/cl/4148045
2011-02-09 14:38:33 -05:00
Russ Cox
56faae21d2 syscall: do not use NULL for zero-length read, write
Avoids problems running Linux binaries under QEMU.

R=r, gri
CC=golang-dev
https://golang.org/cl/4151043
2011-02-09 14:28:47 -05:00
Roger Peppe
d40ae94993 rpc: make more tolerant of errors.
Add Error type to enable clients to distinguish
between local and remote errors.
Also return "connection shut down error" after
the first error return rather than returning the
same error each time.

R=r
CC=golang-dev
https://golang.org/cl/4080058
2011-02-09 10:57:59 -08:00
Robert Griesemer
d916cca327 go/printer: remove notion of "Styler", remove HTML mode
Neither gofmt nor godoc are making use of a Styler (for
token-specific formatting) anymore. Stylers interacted in complicated
ways with HTML-escaping which was why the printer needed an HTML mode
in the first place.

godoc now uses a more powerful and general text formatting
function that does HTML escaping, text selection, and can
handle token-specific formatting if so desired (currently
used only for comments).

As a consequence, cleaned up uses of go/printer in godoc;
simplified the various write utility functions, and also
removed the need for the "html" template format (in favor of
html-esc which now does the same and is used more pervasively).

Applied gofmt -w src misc to verify no changes occured,
and tested godoc manually.

There should be no visible changes except that (type) code
snippets presented for godoc package documentation now
uses the same formatting as for general source code and
thus comments get the comment-specific color here as well
(not the case at the moment).

(TODO: godoc needs a good automatic test suite).

R=rsc
CC=golang-dev
https://golang.org/cl/4152042
2011-02-09 09:52:32 -08:00
Adam Langley
531fb5413e crypto/x509: add name constraints support.
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4130047
2011-02-09 08:39:31 -05:00
Gustavo Niemeyer
13c95f452e build: Drop syslog on DISABLE_NET_TESTS=1
Even if local, it requires communication with a daemon
which may not be available.  This is creating problems
for getting an Ubuntu package going in Launchpad's PPA.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/3989062
2011-02-08 23:50:23 -05:00
Gustavo Niemeyer
4521782514 cgo: fix handling of signed enumerations
Structs defined in C as containing a field with
an enum type are currently translated to Go as
a struct with an unsigned integer field, even if
some of the values contained in the enum are
negative.

This modification takes in consideration the values
defined in the enum, and conditionally defines the
Go type as signed if necessary.

The logic introduced was tested with gcc, which
will increase the type size if it contains both
negative numbers and values greater than 2^b/2-1,
and refuses to compile values which would be
problematic (2^64-1, but in fact the ISO C
restricts the range to the size of int).

R=rsc
CC=golang-dev
https://golang.org/cl/4119058
2011-02-08 23:50:14 -05:00
Brad Fitzpatrick
2aaabfc828 http: handle unchunked, un-lengthed HTTP/1.1 responses
Fixes #716

This CL simply resumes the previous CL in-flight at
https://golang.org/cl/906042/

R=rsc, petar-m, dsymonds
CC=golang-dev
https://golang.org/cl/4157042
2011-02-08 20:35:02 -08:00
Kyle Consalus
3629d72328 container/ring: Replace Iter() with Do().
Faster in most cases, and not prone to memory leaks. Named "Do" to match with similarly named method on Vector.

R=gri
CC=golang-dev
https://golang.org/cl/4134046
2011-02-08 20:07:05 -08:00
Alex Brainman
5e83d40904 syscall: implement windows version of Fsync
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4158043
2011-02-09 14:54:54 +11:00
Russ Cox
e6f9b2f110 fix build clean.bash
TBR=r
CC=golang-dev
https://golang.org/cl/4151042
2011-02-08 22:39:39 -05:00
Alex Brainman
642c774081 src/run.bash: get rid of long windows expression
R=rsc
CC=golang-dev
https://golang.org/cl/4138041
2011-02-09 12:37:08 +11:00
Ken Thompson
5080d7617a cgen64: dont use MVN instruction
R=r
CC=golang-dev
https://golang.org/cl/4154043
2011-02-08 17:30:23 -08:00
Ken Thompson
dc331e6565 peep: more optimization
R=r
CC=golang-dev
https://golang.org/cl/4149044
2011-02-08 16:55:59 -08:00
Graham Miller
69334ee62b netchan: graceful handling of closed connection
Currently, when an importer closes the connection, the exporter gives an
error message 'netchan export: error decoding client header:EOF'.  This
change causes the exporter to look for an EOF during the parse of the
header, and silences the log message in that case.

R=r
CC=golang-dev, rog
https://golang.org/cl/4132044
2011-02-08 12:42:31 -08:00
Gustavo Niemeyer
b9183b986a cgo: don't run cgo when not compiling
The logic introduced to avoid running cgo when
introducing _cgo_flags is faulty.  My goal was
to handle it with the following statement:

    -include _cgo_flags

The dash tells make to ignore errors if it can't
include the file.

What I missed, though, was the fact that it
*will* attempt to build the file if it knows
how.

This change will introduce the originally
intended semantics of not attempting to build
the file before necessary.

R=rsc
CC=golang-dev
https://golang.org/cl/4023069
2011-02-08 15:40:11 -05:00
Adam Langley
1b8d373463 crypto/openpgp/packet: add UserId packet type
This was split from CL 4124054

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4126057
2011-02-07 21:40:33 -05:00
Ken Thompson
e26b741523 peep: fix optimization bug
R=r
CC=golang-dev
https://golang.org/cl/4105058
2011-02-07 17:21:04 -08:00
Ken Thompson
2799e0ecb9 peep: fix bug in peep optimizer.
reg: enable peep optimizer.
cgen64: better int64 code.

R=r
CC=golang-dev
https://golang.org/cl/3989065
2011-02-07 15:00:30 -08:00
Russ Cox
223459891e syscall: fix arm build
R=r
CC=golang-dev
https://golang.org/cl/4105057
2011-02-07 17:49:45 -05:00
Rob Pike
0ae041735a ld: fix build (uvlong vs uint64 conflict on freebsd)
R=rsc
CC=golang-dev
https://golang.org/cl/4023071
2011-02-07 14:40:36 -08:00
Rob Pike
fb55941539 loader: move the XputY routines into the ld directory.
Fixes the build for 5l, and also removes an inconsequential bug in 8l.

R=rsc
CC=golang-dev
https://golang.org/cl/4127051
2011-02-07 14:34:21 -08:00
Adam Langley
ab2aca5e52 crypto/tls: select best ciphersuite, not worst.
Previously, the outer loop would continue until we selected the
client's least preferable ciphersuite.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4029056
2011-02-05 13:56:36 -05:00
Adam Langley
566d432f54 asn1: marshal true as 255, not 1.
OS X, at least, appears to test |byte == 255|, not |byte != 0| to
establish if a bool is true or false.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4128064
2011-02-05 13:55:37 -05:00
Adam Langley
5626bd9e38 crypto/tls: load a chain of certificates from a file.
Many recently issued certificates are chained: there's one or more
intermediate certificates between the host certificate and the root CA
certificate. This change causes the code to load any number of
certificates from the certificate file. This matches the behaviour of
common webservers, and the output of OpenSSL's command line tools.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4119057
2011-02-05 13:54:25 -05:00
Adam Langley
c63a88072b crypto/openpgp/packet: two more packet types.
R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4124054
2011-02-05 12:06:42 -05:00
Robert Griesemer
d812e8c994 go/printer, gofmt: smarter handling of multi-line raw strings
If a multi-line raw string is the first token on a line, it
should not be indented because the following lines (belonging
to the raw string) are not indented either.

Adjusted src of ebnf/ebnf_test.go manually as it now is formatted
as expected.

gofmt -w src misc

Fixes #1072.

R=r
CC=golang-dev
https://golang.org/cl/4119056
2011-02-04 17:34:16 -08:00
Kyle Consalus
42973dddf4 template: Add simple formatter chaining.
Fixes #676.

R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/4127043
2011-02-04 16:37:30 -08:00
Robert Griesemer
eeafc06538 gofmt: no need for lexical compare of src and res (optimization)
R=r
CC=golang-dev
https://golang.org/cl/4130046
2011-02-04 15:36:32 -08:00
Rob Pike
5008c63e6e template: allow a leading '*' to indicate that evaulation should
indirect through a pointer.

Fixes #1478.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4131045
2011-02-04 15:21:08 -08:00
Rob Pike
6e615a57af scan: permit base prefixes 0nnn and 0xnn when scanning
signed or unsigned integers using %v or the formatless scanner.
That is, Sscan("0x11", &i) or Sscanf("0x11", "%v", &i) will now
set i to 17.   If a format other than %v is presented, the behavior
is as before.

Fixes #1469.

R=rsc
CC=golang-dev
https://golang.org/cl/4131042
2011-02-04 13:14:38 -08:00
Yuval Pavel Zholkover
c14c4e55e0 8l: fix crash writing Plan 9 binaries
Was crashing with GOOS=plan9 unless -s was passed.
Add symbols and line numbers to Plan 9 a.out.

R=rsc
CC=golang-dev
https://golang.org/cl/4080050
2011-02-04 14:33:21 -05:00
Russ Cox
6c5e4e1854 build: allow clean.bash to work on fresh checkout
Must be invoked as ./clean.bash --gomake make
(or --gomake gmake, depending on the name of
GNU make).

R=niemeyer
CC=golang-dev
https://golang.org/cl/4023065
2011-02-04 14:33:08 -05:00
Russ Cox
4fa6d57f6e runtime: fix asm.h on Windows
Thanks to mhantsch@gmail.com.

R=adg, brainman
CC=golang-dev
https://golang.org/cl/4092048
2011-02-04 14:32:59 -05:00
Adam Langley
4a14bc524b crypto/openpgp/packet: add public key support
Note that DSA public key support is nascent and the verification
functions clearly don't support it yet. I'm intending to get RSA keys
working first.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3973054
2011-02-04 09:00:17 -05:00
Alex Brainman
4ecebfea53 os: implement new Process api
Fixes #1004.
Fixes #1460.

R=mattn, r, niemeyer, rog, rsc
CC=golang-dev
https://golang.org/cl/4029053
2011-02-04 14:41:26 +11:00
Yasuhiro Matsumoto
8b9d6e38be gopack: unused variable.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4121057
2011-02-03 17:29:09 -08:00
Robert Griesemer
ea2c6a3e59 godoc: minor internal fix
The value of the internal flag includeNonGoFile
really is the value of the fulltextIndex flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4044052
2011-02-03 16:05:57 -08:00
Rob Pike
7db904c1f6 regexp: add support for matching text read from things that implement
ReadRune.  (If you have a Reader but not a RuneReader, use bufio.)

The matching code is a few percent slower but significantly cleaner.

R=rsc
CC=golang-dev
https://golang.org/cl/4125046
2011-02-03 13:58:40 -08:00
Gustavo Niemeyer
63457d089e sync: Proposal for barrier implementation
As discussed in the mailing list, this adds a simple barrier
implementation to the sync package which enables one or more
goroutines to wait for a counter to go down to zero.

R=rsc, rog, r
CC=golang-dev
https://golang.org/cl/3770045
2011-02-03 12:39:11 -08:00
Rob Pike
8bf0bc2754 fmt: document %%
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4130044
2011-02-03 11:55:33 -08:00
Russ Cox
9d3db4b62e gotest: enable unit tests for cmd directories
R=r
CC=golang-dev
https://golang.org/cl/4001056
2011-02-03 14:54:01 -05:00
Russ Cox
c1a695c160 gc, ld: package name main no longer reserved
R=ken2
CC=golang-dev
https://golang.org/cl/4128054
2011-02-03 14:17:20 -05:00
Dave Cheney
eff1952873 syscall: add SetsockoptIpMreq
notes:
* due to Issue 1466 the Msghdr struct for
 src/pkg/syscall/ztypes_darwin_386.go
 src/pkg/syscall/ztypes_darwin_amd64.go
had to be edited after the godefs generation.
* ztypes_*.go files for linux, freebsd and darwin
have been prepared on the correct host OS and ARCH.
While the total increase is a dozen lines per file
the diff is larger due to a change to godefs,
 http://code.google.com/p/go/source/detail?r=c79e30afe9c8
while has altered the names of Pad members which
causes gofmt to realign the affected structs

R=rsc, mikioh
CC=golang-dev
https://golang.org/cl/4119053
2011-02-03 14:15:35 -05:00
Gustavo Niemeyer
ab15a978fb cgo: os/arch dependent #cgo directives
This enables #cgo directives to contain a os/arch
specification which restricts the definition of
the given option to matching systems.

For example:

#cgo amd64 CFLAGS: -DAMD64=1
#cgo linux CFLAGS: -DLINUX=1
#cgo linux/amd64 CFLAGS: -DLINUX_ON_AMD64=1

R=rsc
CC=golang-dev
https://golang.org/cl/4121048
2011-02-03 13:51:47 -05:00
Russ Cox
3f61184e1b gc, ld: detect stale or incompatible object files
The object files begin with a header that is

        $GOARCH

on a line by itself.  This CL changes that header to

        go object $GOOS $GOARCH release.2011-01-01 4567+

where the final two fields are the most recent release
tag and the current hg version number.

All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.

The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.

Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.

This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.

It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4023063
2011-02-03 13:51:43 -05:00
Adam Langley
364cb831f7 crypto/openpgp/packet: add basic routines
Since nobody suggested major changes to the higher level API, I'm
splitting up the lower level code for review. This is the first of the
changes for the packet reading/writing code.

It deliberately doesn't include a Makefile because the package is
incomplete.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4080051
2011-02-03 09:22:40 -05:00
Adam Langley
2a2995cec8 crypto/openpgp/armor: bug fixes
* Don't require lines to be full.
* Don't forget to flush the line buffer.
* Update the test so that it doesn't happen to include only full lines
  in order to test the above.
* Always write the line after the header as GNUPG expects it.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4124043
2011-02-03 09:19:20 -05:00
Adam Langley
fc5c1f0a18 crypto/cipher: add resync open to OCFB mode.
OpenPGP changed its OCFB mode for more modern packets (for example, the
MDC symmetrically encrypted packet). This change adds a bool to
determine which mode is used.

R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4126041
2011-02-03 09:17:42 -05:00
Christopher Nielsen
31ccf19612 build: fix spaces in GOROOT
Fixes #1413.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4007041
2011-02-03 00:42:03 -05:00
Russ Cox
1e063b32cd runtime: faster allocator, garbage collector
GC is still single-threaded.
Multiple threads will happen in another CL.

Garbage collection pauses are typically
about half as long as they were before this CL.

R=brainman, iant, r
CC=golang-dev
https://golang.org/cl/3975046
2011-02-02 23:03:47 -05:00
Russ Cox
6b93a92ac0 windows: fix build?
Shot in the dark.

TBR=r
CC=golang-dev
https://golang.org/cl/4126054
2011-02-02 22:53:10 -05:00
Gustavo Niemeyer
34336bd9f3 cgo: fix _cgo_run timestamp file order
The timestamp file is being created before cgo
runs, which means errors will not prevent it
from being created and thus will cause the
build to break by rendering the rule up-to-date
when it isn't.

R=rsc
CC=golang-dev
https://golang.org/cl/4001049
2011-02-02 22:37:40 -05:00
Eoghan Sherry
cf63e34b1d gc: correct rounding of denormal constants
Fixes #1463.

R=rsc
CC=golang-dev
https://golang.org/cl/4079060
2011-02-02 22:36:54 -05:00
Hector Chu
fb9fc886ff windows: syscall: Make ForkExec acquire the ForkLock
so that spawned processes avoid inheriting pipes.

Implement CloseOnExec.
Make file and pipe handles inheritable.

R=rsc, brainman, vincent.vanackere
CC=golang-dev
https://golang.org/cl/4126047
2011-02-03 12:50:41 +11:00
Russ Cox
259a974292 cgo: rename internal f to avoid conflict with possible C global named f
Fixes #1452.

R=r
CC=golang-dev
https://golang.org/cl/4023060
2011-02-02 18:53:03 -05:00
Russ Cox
8a2891fc56 gc: select receive bug fix
Affects receive using := when new variable escapes to heap.

Fixes #1468.

R=ken2
CC=golang-dev
https://golang.org/cl/4119052
2011-02-02 18:34:09 -05:00
Robert Griesemer
c5fc3b6972 fmt: rename internal interfaces
readRuner -> runeReader
unreadRuner -> runeUnreader

R=r, rsc
CC=golang-dev
https://golang.org/cl/4000054
2011-02-02 15:00:14 -08:00
Russ Cox
b287d7cbe1 runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces.  Also mark stack segment boundaries
as an aid to debugging.

Correct various line number bugs with yet another attempt
at interpreting the pc/ln table.  This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.

Fixes #1138.
Fixes #1430.
Fixes #1461.

throw: runtime: split stack overflow

runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
        runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
        runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
        runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
        runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
        gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
        gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
        gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
        testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
        runtime.goexit()

R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 16:44:20 -05:00
Robert Griesemer
827e98d4fd io: rename interfaces
ReadByter -> ByteReader
ReadRuner -> RuneReader

R=r, r2, rsc
CC=golang-dev
https://golang.org/cl/4023062
2011-02-02 13:42:15 -08:00
Rob Pike
029bbe18e0 fmt.Scan: scan binary-exponent floating format, 2.4p-3
R=rsc, rog, r2
CC=golang-dev
https://golang.org/cl/4128049
2011-02-02 12:38:48 -08:00
Russ Cox
bc874ec0dd runtime: correct runtime.GOOS, runtime.GOARCH
If the same directory was used for multiple builds,
it was possible for a stale version.go to contain the
wrong definitions for $GOOS and $GOARCH, because
they can change even if the hg version does not.
Split into multiple files to fix.

R=r, r2
CC=golang-dev
https://golang.org/cl/4124050
2011-02-02 15:35:54 -05:00
Rob Pike
7c189a8417 sync: tidy a couple of comments.
no semantic change.

R=rsc
CC=golang-dev
https://golang.org/cl/4128048
2011-02-01 21:29:46 -08:00
Rob Pike
03a93158d2 fmt: document %b for floating point
R=rsc
CC=golang-dev
https://golang.org/cl/4073051
2011-02-01 21:10:16 -08:00
Rob Pike
622d729b86 io: add ReadRuner
Put it in the same package as ReadByter.
There is no implementation here for either interface.

R=rsc
CC=golang-dev
https://golang.org/cl/4121051
2011-02-01 21:09:33 -08:00