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

12681 Commits

Author SHA1 Message Date
Adam Langley
ce5d91baa5 compress/bzip2: don't panic on invalid input.
Fixes 5747.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/10401050
2013-06-24 10:59:41 -04:00
Alex Brainman
05a5de30f0 runtime: do not generate code during runtime in windows NewCallback
Update #5494

R=golang-dev, minux.ma, rsc, iant
CC=golang-dev
https://golang.org/cl/10368043
2013-06-24 17:17:45 +10:00
Dave Cheney
28a55111b2 os: rename error_posix.go to error_unix.go
The tradition is to use _posix when the platform extends beyond unix variants. As windows has its own file, rename to the more usual _unix.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10320043
2013-06-24 11:23:37 +10:00
Rémy Oudompheng
20ebee2c31 cmd/gc: fix pointer composite literals in exported if statements.
Fixes #4230 (again).

R=rsc, golang-dev, r
CC=golang-dev
https://golang.org/cl/10470043
2013-06-23 18:39:07 +02:00
Rick Arnold
fc0b5ef0fd time: handle integer overflow in Sub
If time.Sub results in a value that won't fit in a Duration (int64),
return either the min or max int64 value as appropriate.

Fixes #5011.

R=golang-dev, bradfitz, r, rsc
CC=golang-dev
https://golang.org/cl/10328043
2013-06-21 18:07:57 -07:00
Dave Cheney
dd3a3cfa49 syscall: reduce duplication between *bsd and linux
See discussion: https://groups.google.com/forum/#!topic/golang-dev/zSmH0lQxKAs

Part 1 of several.

Move identical types and functions to syscall_unix.go.

R=rsc, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/10392048
2013-06-22 11:03:40 +10:00
Robert Griesemer
fc1e298ba1 go/parser: always provide a non-nil path for imports
The go/ast ImportSpec always requires a non-nil path.

R=adonovan
CC=golang-dev
https://golang.org/cl/10402047
2013-06-21 15:09:04 -07:00
Rob Pike
279c48444a testing: include cover mode in cover profile
R=adg, rsc
CC=golang-dev
https://golang.org/cl/10392049
2013-06-21 14:19:08 -07:00
Robert Griesemer
f243584d29 go/*: support for slices with cap: s[:j:k] and s[i:j:k]
Experimental, per rsc's proposal.

R=rsc
CC=golang-dev
https://golang.org/cl/10204043
2013-06-21 13:14:06 -07:00
Adam Langley
6bea504b94 cmd/6a, cmd/6l: add PCLMULQDQ instruction.
This Intel instruction implements multiplication in binary fields.

R=golang-dev, minux.ma, dave, rsc
CC=golang-dev
https://golang.org/cl/10428043
2013-06-21 15:17:13 -04:00
Dave Cheney
a00958aac6 all: avoid leaking fds during tests
trivial: it is not a serious problem to leak a fd in a short lived process, but it was obscuring my investigation of issue 5593.

R=golang-dev, iant, bradfitz
CC=golang-dev
https://golang.org/cl/10391043
2013-06-21 11:13:14 +10:00
Rob Pike
0bc7e79afd all: excise some warts found by vet -shadow
These are not erroneous, just poor or confusing.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10448043
2013-06-20 16:14:40 -07:00
Brad Fitzpatrick
5b0bf9db8e net/http: fix confusing shadowing in ProxyFromEnvironment
The old code worked, somewhat on accident, but was confusing,
and had a useless assignment to the inner err. It worked
because url.Parse parses just about anything, so the outer err
was always nil, so it always fell through to the bottom return
statement, even without the "err = nil" line.

Instead, just have two return statements, and add a comment.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10448044
2013-06-20 11:58:24 -07:00
Rob Pike
3e710c0ba5 all: fix shadowing bugs found by go tool vet -shadow
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10328044
2013-06-20 11:50:44 -07:00
Rob Pike
9824b018ce cmd/go: put the coverage information on the summary line.
Output now:
ok  	crypto/aes	0.060s	coverage: 89.8% of statements
ok  	crypto/des	0.074s	coverage: 92.2% of statements
ok  	crypto/dsa	0.056s	coverage: 34.5% of statements
ok  	crypto/ecdsa	0.058s	coverage: 86.8% of statements
ok  	crypto/elliptic	0.039s	coverage: 94.6% of statements
ok  	crypto/hmac	0.037s	coverage: 93.5% of statements
ok  	crypto/md5	0.031s	coverage: 96.2% of statements
ok  	crypto/rand	0.074s	coverage: 9.9% of statements
ok  	crypto/rc4	0.090s	coverage: 66.7% of statements
ok  	crypto/rsa	0.253s	coverage: 83.5% of statements

R=rsc, adg
CC=golang-dev
https://golang.org/cl/10413044
2013-06-20 10:27:44 -07:00
Adam Langley
9035297266 crypto/x509: add function to marshal EC private keys.
This complements the parsing function that we already have.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10426043
2013-06-20 12:14:16 -04:00
Andrew Gerrand
2f70ac19d2 cmd/go: document that files beginning with . or _ are ignored
Fixes #5655.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/10410045
2013-06-20 10:29:38 +10:00
Adam Langley
966e889687 crypto/tls: change advertised ciphersuite order.
TLS clients send ciphersuites in preference order (most prefereable
first). This change alters the order so that ECDHE comes before plain
RSA, and RC4 comes before AES (because of the Lucky13 attack).

This is unlikely to have much effect: as a server, the code uses the
client's ciphersuite order by default and, as a client, the non-Go
server probably imposes its order.

R=golang-dev, r, raggi, jsing
CC=golang-dev
https://golang.org/cl/10372045
2013-06-19 16:46:53 -04:00
Rob Pike
cb2461ba46 cmd/go: another attempt at flag handling for coverage
The -cover flag is now just enable/disable and is implied if
either of the other flags is set.

R=rsc
CC=golang-dev
https://golang.org/cl/10420043
2013-06-19 09:44:40 -07:00
Rob Pike
27cca31ee1 cmd/go: simplify flags for coverage
The single flag -cover provides the default simplest behavior.
The other flags, -covermode and -coverprofile, provide more
control. The three flags interconnect to work well.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/10364044
2013-06-18 17:15:26 -07:00
Rob Pike
8e8b8b85c2 cmd/go: write coverage to file, add percentage statistic
Move the data dumper to the testing package, where it has access
to file I/O.
Print a percentage value at the end of the run.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/10264045
2013-06-18 14:18:25 -07:00
Robert Griesemer
6154ae8e24 math/big: fix Errorf verb
Pointed out by go vet.

R=r
CC=golang-dev
https://golang.org/cl/10368048
2013-06-18 14:16:40 -07:00
Russ Cox
269b2f2d4d cmd/gc: fix race detector on tail-call wrappers
(By not using the tail-call wrappers when the race
detector is enabled.)

R=golang-dev, minux.ma, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/10227043
2013-06-18 14:43:37 -04:00
Cosmos Nicolaou
f882bc8708 os/exec: make exec_test.go:TestExtraFilesFDShuffle portable.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9103045
2013-06-18 08:55:32 -07:00
Dave Cheney
f9c22f7e78 cmd/cgo: avoid leaking fds
Fixes #5714.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10386043
2013-06-18 23:20:17 +10:00
Alex Jin
83db738786 net/smtp: close conn in SendMail; add Client.Close method
R=rsc, dave, bradfitz
CC=golang-dev
https://golang.org/cl/10082044
2013-06-17 16:53:27 -07:00
Paul van Brouwershaven
4bd79e742a crypto/x509: Added RFC 5280, section 4.2.1.14 to parseCertificate and buildExtensions
Support for CRL Distribution Points

R=golang-dev, agl, bradfitz
CC=golang-dev
https://golang.org/cl/10258043
2013-06-17 14:56:45 -07:00
Nicolas Owens
2af974777d net: fix LookupNS on Plan 9
use correct field count when resolving nameservers via /net/dns on Plan 9.

we incorrectly check for 4 fields instead of 3 when parsing the result of /net/dns, and get no results

R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/10182044
2013-06-17 11:38:07 -07:00
Dan Peterson
563d09cd14 testing: use -bench flag and fix flags doc link
R=golang-dev, r, kr
CC=golang-dev
https://golang.org/cl/10263043
2013-06-17 07:32:28 -07:00
Brad Fitzpatrick
14e52c74bc crypto/cipher: StreamWriter.Closer docs + behavior change
Don't panic when the underlying Writer isn't a Closer. And
document what Close does and clarify that it's not a Flush.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/10310043
2013-06-17 07:30:04 -07:00
Dmitriy Vyukov
d660688f14 runtime/race: add tests for method thunks
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10257043
2013-06-17 17:59:53 +04:00
Dmitriy Vyukov
f84cbd0950 runtime: fix test for new closure representation
I've hit it several times already.
Currently it crashes with nil deref.

R=golang-dev, daniel.morsing, r
CC=golang-dev
https://golang.org/cl/10317045
2013-06-17 15:41:17 +04:00
Benny Siegert
8a4efed63c run.bash: raise ulimit for the number of threads.
This is needed on NetBSD-current. Support for
ulimit -T in bash was added in 4.2nb3.

R=golang-dev, minux.ma, rsc, dave
CC=golang-dev
https://golang.org/cl/10078047
2013-06-17 19:31:58 +10:00
Dmitriy Vyukov
94dc963b55 runtime: fix race condition between GC and setGCPercent
If first GC runs concurrently with setGCPercent,
it can overwrite gcpercent value with default.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10242047
2013-06-15 16:07:06 +04:00
Dmitriy Vyukov
4bb491b12e runtime: improve scheduler fairness
Currently global runqueue is starved if a group of goroutines
constantly respawn each other (local runqueue never becomes empty).
Fixes #5639.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10042044
2013-06-15 16:06:28 +04:00
Dmitriy Vyukov
5caf762457 runtime: remove unused moreframesize_minalloc field
It was used to request large stack segment for GC
when it was running not on g0.
Now GC is running on g0 with large stack,
and it is not needed anymore.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10242045
2013-06-15 16:02:39 +04:00
Jonathan Rudenberg
8f6341d9ee cmd/godoc: don't link unexported identifiers
R=golang-dev, gri, gri
CC=golang-dev
https://golang.org/cl/9722045
2013-06-14 12:37:23 -07:00
Keith Randall
de316388a7 runtime: garbage collector runs on g0 now.
No need to change to Grunnable state.
Add some more checks for Grunning state.

R=golang-dev, rsc, khr, dvyukov
CC=golang-dev
https://golang.org/cl/10186045
2013-06-14 11:42:51 -07:00
Brad Fitzpatrick
61d3b2db62 net: coalesce duplicate in-flight DNS lookups
In Issue 5625, Russ says: "We should at least have a cache of
inflight lookups, so that 100 simultaneous dials of one host
name don't do the work 100x. That's easy and (assume we forget
the answer once they all get it) doesn't pose any consistency
problems. It just merges simultaneous work."

This brings in singleflight (unexported) from Google /
Camlistore, but without its tests. Maybe we should put it
somewhere in the standard library. But not now.

Update #5625

R=golang-dev, iant, cespare, rsc, dave, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/10079043
2013-06-14 08:59:43 -07:00
Rémy Oudompheng
3be794cdc2 cmd/gc: instrument arrays properly in race detector.
The previous implementation would only record access to
the address of the array but the memory access to the whole
memory range must be recorded instead.

R=golang-dev, dvyukov, r
CC=golang-dev
https://golang.org/cl/8053044
2013-06-14 11:14:45 +02:00
Caleb Spare
bc08124866 strconv: corrected several bad references to err.Error in doc comments.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10253051
2013-06-13 17:04:47 -07:00
Rob Pike
92ea9fa108 cmd/go: change to use struct in go test -cover
Go tool half of https://golang.org/cl/10271044

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/10272043
2013-06-13 13:12:58 -07:00
Alan Donovan
568c4617ec go/ast: add {L,R}paren token.Pos field to ast.TypeAssertExpr.
These are required to correctly determine the End() of the node.

Also set these fields in go/parser and use them in go/printer.

This is a backward-compatible API change.

R=gri, r
CC=golang-dev
https://golang.org/cl/10189043
2013-06-13 14:41:44 -04:00
Dmitriy Vyukov
b9ddb0d8b3 runtime: fix bug introduced in cl/10256043
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10260043
2013-06-13 16:40:10 +04:00
Dmitriy Vyukov
e2d95c1f24 runtime/race: remove now unused step parameter from range access functions
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10259043
2013-06-13 16:38:44 +04:00
Dmitriy Vyukov
591d58a3bb cmd/gc: properly race-instrument for loops
Instrumentation of ntest expression should go to ntest->init.
Same for nincr.
Fixes #5340.

R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/10026046
2013-06-13 16:03:58 +04:00
Dmitriy Vyukov
2ffaefd161 runtime: use ROUND macro for rounding
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/10256043
2013-06-13 16:02:50 +04:00
Dmitriy Vyukov
cc99e6e949 runtime/race: update runtime to r183644
This revision properly handles memory range accesses.
Fixes #4453.
Fixes #5654.

R=golang-dev, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/10082043
2013-06-13 14:32:05 +04:00
Rob Pike
28a1c36d62 testing: add -outputdir flag so "go test" controls where the files are written
Obscure misfeature now fixed: When run from "go test", profiles were always
written in the package's source directory. This change puts them in the directory
where "go test" is run.
Also fix a couple of problems causing errors in testing.after to go unreported
unless -v was set.

R=rsc, minux.ma, iant, alex.brainman
CC=golang-dev
https://golang.org/cl/10234044
2013-06-12 18:13:34 -07:00
Ian Lance Taylor
0627248a1f runtime: update runtime·gogo comment in asm files
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/10244043
2013-06-12 15:05:10 -07:00
Russ Cox
d67e7e3acf runtime: add lr, ctxt, ret to Gobuf
Add gostartcall and gostartcallfn.
The old gogocall = gostartcall + gogo.
The old gogocallfn = gostartcallfn + gogo.

R=dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/10036044
2013-06-12 15:22:26 -04:00
Dmitriy Vyukov
a8ad859c30 runtime: more flexible heap memory mapping on 64-bits
Fixes #5641.

R=golang-dev, dave, daniel.morsing, iant
CC=golang-dev, kcc
https://golang.org/cl/10126044
2013-06-12 18:47:16 +04:00
Dmitriy Vyukov
dbcfed93e7 runtime: fix scheduler race condition
In starttheworld() we assume that P's with local work
are situated in the beginning of idle P list.
However, once we start the first M, it can execute all local G's
and steal G's from other P's.
That breaks the assumption above. Thus starttheworld() will fail
to start some P's with local work.
It seems that it can not lead to very bad things, but still
it's wrong and breaks other assumtions
(e.g. we can have a spinning M with local work).
The fix is to collect all P's with local work first,
and only then start them.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10051045
2013-06-12 18:46:35 +04:00
Russ Cox
e5cbebc1ad runtime: fix plan9, windows builds
TBR=dvyukov
CC=golang-dev
https://golang.org/cl/10229043
2013-06-12 09:41:29 -04:00
Russ Cox
80efeff20a runtime: fix build
TBR=dvyukov
CC=golang-dev
https://golang.org/cl/10227044
2013-06-12 09:06:28 -04:00
Russ Cox
e58f798c0c runtime: adjust traceback / garbage collector boundary
The garbage collection routine addframeroots is duplicating
logic in the traceback routine that calls it, sometimes correctly,
sometimes incorrectly, sometimes incompletely.
Pass necessary information to addframeroots instead of
deriving it anew.

Should make addframeroots significantly more robust.
It's certainly smaller.

Also try to standardize on uintptr for saved pc, sp values.

Will make CL 10036044 trivial.

R=golang-dev, dave, dvyukov
CC=golang-dev
https://golang.org/cl/10169045
2013-06-12 08:49:38 -04:00
Russ Cox
7ea75a5f18 cmd/go: diagnose invalid coverage runs
# bufio
coverage analysis cannot handle package (bufio_test imports testing imports bufio)
# bytes
coverage analysis cannot handle package (bytes_test imports encoding/base64 imports bytes)
# crypto/cipher
coverage analysis cannot handle package (cipher_test imports crypto/aes imports crypto/cipher)
# debug/dwarf
coverage analysis cannot handle package (dwarf_test imports debug/elf imports debug/dwarf)
# errors
coverage analysis cannot handle package (errors_test imports fmt imports errors)
# flag
coverage analysis cannot handle package (flag_test imports testing imports flag)
# fmt
coverage analysis cannot handle package (fmt_test imports testing imports fmt)
# go/ast
coverage analysis cannot handle package (ast_test imports go/format imports go/ast)
# image
coverage analysis cannot handle package (image_test imports image/gif imports image)
# io
coverage analysis cannot handle package (io_test imports bytes imports io)
# math
coverage analysis cannot handle package (math_test imports fmt imports math)
# net/http
coverage analysis cannot handle package (http_test imports net/http/httptest imports net/http)
# os
coverage analysis cannot handle package (os_test imports flag imports os)
# path/filepath
coverage analysis cannot handle package (filepath_test imports io/ioutil imports path/filepath)
# reflect
coverage analysis cannot handle package (reflect_test imports flag imports reflect)
# runtime
coverage analysis cannot handle package (runtime_test imports fmt imports runtime)
# runtime/pprof
coverage analysis cannot handle package (pprof_test imports testing imports runtime/pprof)
# sort
coverage analysis cannot handle package (sort_test imports testing imports sort)
# strconv
coverage analysis cannot handle package (strconv_test imports fmt imports strconv)
# strings
coverage analysis cannot handle package (strings_test imports testing imports strings)
# sync
coverage analysis cannot handle package (sync_test imports fmt imports sync)
# sync/atomic
coverage analysis cannot handle package (atomic_test imports testing imports sync/atomic)
# syscall
coverage analysis cannot handle package (syscall_test imports flag imports syscall)
# text/tabwriter
coverage analysis cannot handle package (tabwriter_test imports testing imports text/tabwriter)
# time
coverage analysis cannot handle package (time_test imports encoding/gob imports time)
# unicode
coverage analysis cannot handle package (unicode_test imports testing imports unicode)
# unicode/utf8
coverage analysis cannot handle package (utf8_test imports bytes imports unicode/utf8)

R=r
CC=golang-dev
https://golang.org/cl/10216043
2013-06-12 08:42:05 -04:00
Shenghou Ma
da634dd703 cmd/go: clarify test filenames in help messages
Fixes #5655.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9944044
2013-06-12 19:40:58 +08:00
Rob Pike
bc7e26621e cmd/go: use -o option of cover tool
Separates correct from erroneous output so errors running the tool will appear
in the log.

R=rsc
CC=golang-dev
https://golang.org/cl/10191043
2013-06-11 20:47:35 -07:00
Ian Lance Taylor
ae5e791ed2 cmd/gc: save local var list before inlining
This avoids problems with inlining in genwrappers, which
occurs after functions have been compiled.  Compiling a
function may cause some unused local vars to be removed from
the list.  Since a local var may be unused due to
optimization, it is possible that a removed local var winds up
beingused in the inlined version, in which case hilarity
ensues.

Fixes #5515.

R=golang-dev, khr, dave
CC=golang-dev
https://golang.org/cl/10210043
2013-06-11 20:23:21 -07:00
Russ Cox
e440354c40 cmd/gc: turn race detector off for tail-call method wrapper functions
It was off in the old implementation (because there was no high-level
description of the function at all). Maybe some day the race detector
should be fixed to handle the wrapper and then enabled for it, but there's
no reason that has to be today.

R=golang-dev
TBR=dvyukov
CC=golang-dev
https://golang.org/cl/10037045
2013-06-11 22:37:07 -04:00
Shenghou Ma
e50e4f7ec1 cmd/ld: supply -s to gcc if -s is passed.
Fixes #5463.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9239045
2013-06-12 06:56:50 +08:00
Shenghou Ma
ccd1d07cc4 runtime: round spans_size up to page boundary
in case we have weird (not page aligned) memory limit.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10199043
2013-06-12 05:22:49 +08:00
Russ Cox
6120ef0799 runtime: rename _rt0_$GOARCH to _rt0_go
There's no reason to use a different name on each architecture,
and doing so makes it impossible for portable code to refer to
the original Go runtime entry point. Rename it _rt0_go everywhere.

This is a global search and replace only.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/10196043
2013-06-11 16:49:24 -04:00
Rémy Oudompheng
880d869764 cmd/gc: compute initialization order for top-level blank vars too.
Fixes #5244.

R=golang-dev, rsc, iant, r, daniel.morsing
CC=golang-dev
https://golang.org/cl/8601044
2013-06-11 22:21:51 +02:00
Daniel Morsing
e7657de717 cmd/gc: avoid creating circular lists when compiling with race detector.
Fixes #5431.

R=dvyukov, remyoudompheng, rsc
CC=gobot, golang-dev
https://golang.org/cl/9910043
2013-06-11 21:19:29 +02:00
Rob Pike
caefc5d0ca cmd/go: add coverage analysis
This feature is not yet ready for real use. The CL marks a bite-sized
piece that is ready for review. TODOs that remain:
        provide control over output
        produce output without setting -v
        make work on reflect, sync and time packages
                (fail now due to link errors caused by inlining)
        better documentation
Almost all packages work now, though, if clumsily; try:
        go test -v -cover=count encoding/binary

R=rsc
CC=gobot, golang-dev, remyoudompheng
https://golang.org/cl/10050045
2013-06-11 09:35:10 -07:00
Keith Randall
e4b5cbde46 cmd/cc: emit size of locals. Will be used for stack copying.
R=cshapiro, dvyukov, khr, rsc
CC=golang-dev
https://golang.org/cl/10005044
2013-06-11 09:01:27 -07:00
Russ Cox
1f51d27922 cmd/gc: move genembedtramp into portable code
Requires adding new linker instruction
        RET	f(SB)
meaning return but then immediately call f.
This is what you'd use to implement a tail call after
fiddling with the arguments, but the compiler only
uses it in genwrapper.

This CL eliminates the copy-and-paste genembedtramp
functions from 5g/8g/6g and makes the code run on ARM
for the first time. It removes a small special case for function
generation, which should help Carl a bit, but at the same time
it does not bother to implement general tail call optimization,
which we do not want anyway.

Fixes #5627.

R=ken2
CC=golang-dev
https://golang.org/cl/10057044
2013-06-11 09:41:49 -04:00
Alex Brainman
9b2561ef16 os: request appropriate access rights before calling windows TerminateProcess
Fixes #5615.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9651047
2013-06-11 13:06:38 +10:00
Gerasimos Dimitriadis
02a891b30b asn1: Improved encoding/decoding for OID types
The first identifier in an Object Identifer must be between 0 and 2
inclusive. The range of values that the second one can take depends
on the value of the first one.
The two first identifiers are not necessarily encoded in a single octet,
but in a varint.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/10140046
2013-06-10 18:14:47 -04:00
Shenghou Ma
71051953e0 cmd/ld: document -s flag.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10159043
2013-06-11 04:58:02 +08:00
Russ Cox
5b15b44434 cmd/cc: fix lexbody for negative chars
The new code matches the code in cc/lex.c and the #define GETC.
This was causing problems scanning runtime·foo if the leading
· byte was returned by the buffer fill.

R=ken2
CC=golang-dev
https://golang.org/cl/10167043
2013-06-10 16:13:25 -04:00
Shenghou Ma
35e1deaebf cmd/5l: use BLX for BL (Rx).
Fixes #5111.
Update #4718
This CL makes BL (Rx) to use BLX Rx instead of:
MOV LR, PC
MOV PC, Rx

R=cshapiro, rsc
CC=dave, gobot, golang-dev
https://golang.org/cl/9669045
2013-06-11 03:04:24 +08:00
Dmitriy Vyukov
fd41926347 runtime: fix one-time memory leak on linux
Update #5641.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10144043
2013-06-10 22:59:39 +04:00
Dmitriy Vyukov
62747bde6c runtime: catch races between channel close and channel send in select
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10137043
2013-06-10 22:58:04 +04:00
Shenghou Ma
06f55f5009 net: introduce netgo build tag to build a pure Go net package.
Fixes #4078.

R=golang-dev, bradfitz, rsc, iant
CC=golang-dev
https://golang.org/cl/7100050
2013-06-11 02:55:16 +08:00
Shenghou Ma
b637135003 cmd/cgo: makes clang happy by not using __gcc_struct__ attribute.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10150043
2013-06-11 02:51:01 +08:00
Shenghou Ma
46e30c7d70 syscall: add {Set,Get}priority for Linux, and consistency tests
R=golang-dev, iant, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7430044
2013-06-11 02:47:04 +08:00
Dmitriy Vyukov
fc80764792 runtime/race: tell race detector what memory Read/Write syscalls touch
Fixes #5567.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/10085043
2013-06-10 22:40:35 +04:00
Dmitriy Vyukov
0f4897ae1a sync: improve race instrumentation of WaitGroup
Do not synchronize Add(1) with Wait().
Imitate read on first Add(1) and write on Wait(),
it allows to catch common misuses of WaitGroup:
- Add() called in the additional goroutine itself
- incorrect reuse of WaitGroup with multiple waiters

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10093044
2013-06-10 22:38:58 +04:00
Shenghou Ma
ed6dce6f9d cmd/5l: use guaranteed undefined instruction for UNDEF to match [68]l.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/10085050
2013-06-11 02:02:42 +08:00
Alex Brainman
bb6e265fed os: return io.EOF from windows ReadAt as documented
Fixes #5619.

R=golang-dev, r, peter.armitage, go.peter.90
CC=golang-dev
https://golang.org/cl/9952044
2013-06-10 19:14:41 +10:00
Dmitriy Vyukov
4f514e8691 runtime: use persistentalloc instead of SysAlloc in FixAlloc
Also reduce FixAlloc allocation granulatiry from 128k to 16k,
small programs do not need that much memory for MCache's and MSpan's.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140044
2013-06-10 09:20:27 +04:00
Dmitriy Vyukov
83445fdcc3 runtime: use persistentalloc instead of mallocgc in symtab
Reduces heap size.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140043
2013-06-10 09:17:46 +04:00
Dmitriy Vyukov
99922aba8b runtime: use persistentalloc instead of SysAlloc in GC
Especially important for Windows because it reserves VM
only in multiple of 64k.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/10082048
2013-06-10 09:16:06 +04:00
Dmitriy Vyukov
b36f2db12a runtime: use persistentalloc instead of mallocgc for itab
Reduces heap size.

R=golang-dev, remyoudompheng, bradfitz
CC=golang-dev
https://golang.org/cl/10139043
2013-06-09 21:58:35 +04:00
Dmitriy Vyukov
5290e55164 runtime: use persistentalloc instead of SysAlloc in netpoll
Especially important for Windows because it reserves VM
only in multiple of 64k.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10138043
2013-06-09 21:39:47 +04:00
Dmitriy Vyukov
8cf7044983 runtime: use persistentalloc instead of custom malloc in memory profiler
Removes code duplication.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9874055
2013-06-09 21:38:37 +04:00
Shenghou Ma
949228a322 cmd/cgo: use gcc_struct attribute for packed structs to work around GCC PR52991.
Fixes #5603.

R=iant, dave
CC=gobot, golang-dev
https://golang.org/cl/9895043
2013-06-09 22:06:29 +08:00
Shenghou Ma
e880ab112e runtime: remove unused file mkversion.c
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10107044
2013-06-09 22:04:17 +08:00
Shenghou Ma
faef52c214 all: fix typos
R=golang-dev, bradfitz, khr, r
CC=golang-dev
https://golang.org/cl/7461046
2013-06-09 21:50:24 +08:00
Roger Peppe
822da40814 cmd/go: update go vet documentation
R=rsc, minux.ma, r
CC=golang-dev
https://golang.org/cl/10110043
2013-06-07 19:01:07 +01:00
Ian Lance Taylor
b6e52ecffa runtime: remove unused mid function
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10036047
2013-06-06 18:10:42 -07:00
Dmitriy Vyukov
8bf57c3dcb runtime: remove unused field from Hchan
Remove alignment logic as well, it's not respected by chanbuf() anyway.

R=golang-dev, dave, minux.ma, r, iant, rsc
CC=golang-dev
https://golang.org/cl/9678046
2013-06-06 23:06:12 +04:00
Dmitriy Vyukov
5d637b83a9 runtime: speedup malloc stats collection
Count only number of frees, everything else is derivable
and does not need to be counted on every malloc.
benchmark                    old ns/op    new ns/op    delta
BenchmarkMalloc8                    68           66   -3.07%
BenchmarkMalloc16                   75           70   -6.48%
BenchmarkMallocTypeInfo8           102           97   -4.80%
BenchmarkMallocTypeInfo16          108          105   -2.78%

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/9776043
2013-06-06 14:56:50 +04:00
Alex Brainman
07ea243d50 time: provide timezone abbreviations on windows
Use http://unicode.org/cldr/data/common/supplemental/windowsZones.xml
to generate the map.

Fixes #4838.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9997043
2013-06-06 16:30:25 +10:00
Robert Obryk
9614119007 io/ioutil: make WriteFile notice errors from Close()
WriteFile should not successfully return if the file's
Close call failed.

Fixes #5644.

R=golang-dev, kr, r
CC=golang-dev
https://golang.org/cl/10067043
2013-06-05 21:16:44 -07:00
Russ Cox
f268c295a3 cmd/6c: use full 64-bit address in block copy
Already fixed independently in Plan 9.

R=ken2
CC=golang-dev
https://golang.org/cl/10041044
2013-06-05 10:39:06 -04:00
Russ Cox
26d43a0f22 cmd/6l: accept NOP of $x+10(SP) and of X0
Needed to link code compiled with 6c -N.

R=ken2
CC=golang-dev
https://golang.org/cl/10043044
2013-06-05 10:38:52 -04:00