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

6601 Commits

Author SHA1 Message Date
Marcel van Lohuizen
b8b329451c exp/locale/collate: implementation of tailorings and table generation.
Tailorings are represented by removing and reinserting entries from a linked list.
After all tailorings are done, missing weights are computed and verified.
This implementation assumes that entries that are used in expansions are not
reinserted at a later point.  This considerably simplifies the implementation.

R=r
CC=golang-dev
https://golang.org/cl/6739052
2012-10-31 14:28:44 +01:00
Marcel van Lohuizen
4c1a6f84f8 exp/locale/collate: removed weights struct to allow for faster and easier
incremental comparisons. Instead, processing is now done directly on colElems.
As a result, the size of the weights array is now reduced by 75%.
Details:
- Primary value of type 1 colElem is shifted by 1 bit so that primaries
  of all types can be compared without shifting.
- Quaternary values are now stored in the colElem itself. This is possible
  as quaternary values other than 0 or maxQuaternary are only needed when other
  values are ignored.
- Simplified processWeights by removing cases that are needed for ICU but not
  for us (our CJK primary values fit in a single value).

R=r
CC=golang-dev
https://golang.org/cl/6817054
2012-10-31 14:28:18 +01:00
Marcel van Lohuizen
bc0783dbe5 exp/locale/collate: add context to entry.
R=r
CC=golang-dev
https://golang.org/cl/6727049
2012-10-31 14:02:43 +01:00
Peter Waller
3494010f7d syscall/exec_linux: enable changing controlling tty
As discussed in the following thread:
https://groups.google.com/forum/?fromgroups=#!topic/golang-dev/emeJffxWhVo

This is required to enable applications such as `less` to use something
other than stdin as the controlling terminal.

R=dave, iant
CC=bradfitz, golang-dev
https://golang.org/cl/6785057
2012-10-30 17:36:18 -07:00
Alex Brainman
fa3e4fc429 net: fix connection resets when closed on windows
It is common to close network connection while another goroutine is
blocked reading on another goroutine. This sequence corresponds to
windows calls to WSARecv to start io, followed by GetQueuedCompletionStatus
that blocks until io completes, and, finally, closesocket called from
another thread. We were expecting that closesocket would unblock
GetQueuedCompletionStatus, and it does, but not always
(http://code.google.com/p/go/issues/detail?id=4170#c5). Also that sequence
results in connection is being reset.

This CL inserts CancelIo between GetQueuedCompletionStatus and closesocket,
and waits for both WSARecv and GetQueuedCompletionStatus to complete before
proceeding to closesocket.  This seems to fix both connection resets and
issue 4170. It also makes windows code behave similar to unix version.

Unfortunately, CancelIo needs to be called on the same thread as WSARecv.
So we have to employ strategy we use for connections with deadlines to
every connection now. It means, there are 2 unavoidable thread switches
for every io. Some newer versions of windows have new CancelIoEx api that
doesn't have these drawbacks, and this CL uses this capability when available.
As time goes by, we should have less of CancelIo and more of CancelIoEx
systems. Computers with CancelIoEx are also not affected by issue 4195 anymore.

Fixes #3710
Fixes #3746
Fixes #4170
Partial fix for issue 4195

R=golang-dev, mikioh.mikioh, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6604072
2012-10-31 10:24:37 +11:00
Nigel Tao
ad487dad75 image/jpeg: don't call ensureNBits unless we have to.
benchmark                     old ns/op    new ns/op    delta
BenchmarkDecodeBaseline         3155638      2783998  -11.78%
BenchmarkDecodeProgressive      4008088      3660310   -8.68%

R=r, bradfitz
CC=golang-dev
https://golang.org/cl/6775072
2012-10-31 10:02:11 +11:00
Alexey Borzenkov
d12a7d39d1 net: use read deadline in Accept on windows
Fixes #4296.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6815044
2012-10-31 09:58:05 +11:00
Rob Pike
8884fabfd7 reflect: improve documentation for DeepEqual regarding maps
Keys use ==; values use deep equality. Also remove the word 'member'.
Fixes #4258.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6812055
2012-10-30 14:42:47 -07:00
Robert Griesemer
465b9c35e5 gofmt: apply gofmt -w src misc
Remove trailing whitespace in comments.
No other changes.

R=r
CC=golang-dev
https://golang.org/cl/6815053
2012-10-30 13:38:01 -07:00
Robert Griesemer
db2b6ed854 go/printer, gofmt: trim trailing whitespace in comments
Also: updated go fix testcases to pass tests.

Fixes #4310.

R=r
CC=golang-dev
https://golang.org/cl/6810055
2012-10-30 13:09:47 -07:00
Dave Cheney
640d818f2a archive/zip: handle corrupt extra data records
Fixes #4302.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/6811048
2012-10-31 03:51:59 +11:00
Robert Griesemer
d77eb12998 exp/gotype: add more test packages
R=r
CC=golang-dev
https://golang.org/cl/6822051
2012-10-30 09:42:43 -07:00
Brad Fitzpatrick
1d61c9bb3e io: add ByteWriter interface
API change.

R=golang-dev, dsymonds, nigeltao, rsc, r
CC=golang-dev
https://golang.org/cl/6760045
2012-10-30 10:51:29 +01:00
Nigel Tao
daf43ba476 image/jpeg: change block from [64]int to [64]int32.
On 6g/linux:
benchmark                     old ns/op    new ns/op    delta
BenchmarkFDCT                      4606         4241   -7.92%
BenchmarkIDCT                      4187         3923   -6.31%
BenchmarkDecodeBaseline         3154864      3170224   +0.49%
BenchmarkDecodeProgressive      4072812      4017132   -1.37%
BenchmarkEncode                39406920     34596760  -12.21%

Stack requirements before (from 'go tool 6g -S'):
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1352-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$5344-24

after:
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1064-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$2520-24

Also, in encoder.writeSOS, re-use the yBlock scratch buffer for Cb and
Cr. This reduces the stack requirement slightly, but also avoids an
unlucky coincidence where a BenchmarkEncode stack split lands between
encoder.writeByte and bufio.Writer.WriteByte, which occurs very often
during Huffman encoding and is otherwise disasterous for the final
benchmark number. FWIW, the yBlock re-use *without* the s/int/int32/
change does not have a noticable effect on the benchmarks.

R=r
CC=golang-dev, rsc
https://golang.org/cl/6823043
2012-10-30 11:10:08 +11:00
Roger Peppe
9c775353b9 encoding/json: tweak docs
"JSON object" means something specific, which
isn't the case here.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6789044
2012-10-29 20:58:24 +01:00
Dmitriy Vyukov
c242aa34cc syscalls: annotate Sendfile() for race detector
Fixes #4306.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6816054
2012-10-29 23:15:06 +04:00
Pawel Szczur
4918e3a960 net/http/client.go: fix cookie handling on (*Client) Do()
Fix the problem with no cookie handling when sending
other than GET or HEAD request through
(*Client) Do(*Request) (*Resposne, error).
https://code.google.com/p/go/issues/detail?id=3985

Adds a function (*Client) send(*Request) (*Reponse, error):
- sets cookies from CookieJar to request,
- sends request
- parses a reply cookies and updates CookieJar

Fixes #3985

R=bradfitz
CC=gobot, golang-dev
https://golang.org/cl/6653049
2012-10-29 17:56:31 +01:00
Adam Langley
184e7a2bf2 crypto/x509: always write validity times in UTC.
RFC 5280 section 4.1.2.5.1 says so.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6775068
2012-10-29 11:16:58 -04:00
Adam Langley
4d17fe3cd6 encoding/asn1: don't convert UTCTime to UTC.
Previously we converted a time to UTC *and* serialized the timezone of
the original time. With this change, we serialize a UTCTime in the
original timezone.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6817048
2012-10-29 11:16:05 -04:00
Taj Khattra
1158c6b9c6 container/list: fix typo
R=golang-dev, fullung, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6682046
2012-10-28 21:16:50 +11:00
Patrick Smith
3c808164ad sort: Fixed a typo in the documentation for SearchStrings.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6777066
2012-10-28 10:07:59 +11:00
Ian Lance Taylor
5611e8b59f syscall: fix creds_test to reliably close os.File
Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62: 	FileConn: dup: bad file descriptor
FAIL

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6776053
2012-10-26 10:31:03 -07:00
Shenghou Ma
f9902c7197 encoding/binary: ReadVarint reads a signed number, not unsigned number
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6762051
2012-10-26 21:14:34 +08:00
Dave Cheney
067315c647 net: avoid allocation in setAddr
setAddr was showing up in profiles due to string concatenation construction the os.File name field. netFD.sysfile's Name() is never used, except in dup() so I believe it is safe to avoid this allocation.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/6742058
2012-10-26 19:41:21 +11:00
Rémy Oudompheng
38070a72c5 reflect: stop thinking that MaxFloat32 overflows float32.
Fixes #4282.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6759052
2012-10-26 08:39:36 +02:00
Dmitriy Vyukov
320df44f04 runtime: switch to 64-bit goroutine ids
Fixes #4275.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6759053
2012-10-26 10:13:06 +04:00
Marcel van Lohuizen
b575e3ca99 exp/locale/collate: slightly changed collation elements:
- Allow secondary values below the default value in second form. This is
  to support before tags for secondary values, as used by Chinese.
- Eliminate collation elements that are guaranteed to be immaterial
  after a weight increment.

R=r
CC=golang-dev
https://golang.org/cl/6739051
2012-10-25 13:02:31 +02:00
Shenghou Ma
7c412e962c syscall: implement (*PtraceRegs).PC() and SetPC()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6763043
2012-10-25 13:41:04 +08:00
Marcel van Lohuizen
6653d76ef6 exp/locale/collate/build: fixed problem where blocks for first byte need
different indexes for values and index blocks. Fixes many regressions.

R=r
CC=golang-dev
https://golang.org/cl/6737057
2012-10-24 11:41:05 +02:00
Marcel van Lohuizen
34f2050626 exp/locale/collate: clarification in comments on use of returned value.
R=r
CC=golang-dev
https://golang.org/cl/6752043
2012-10-24 11:40:32 +02:00
Marcel van Lohuizen
a35f23f34e exp/locale/collate/tools/colcmp: add locale to output of regression failure.
R=r
CC=golang-dev
https://golang.org/cl/6749058
2012-10-24 11:28:18 +02:00
Shenghou Ma
7c44edf425 runtime, runtime/race: add missing if(raceenabled), update package docs of pkg race
R=dvyukov
CC=golang-dev
https://golang.org/cl/6733058
2012-10-23 02:33:51 +08:00
Robert Griesemer
7c03cd32b6 exp/type/staging: implemented recent spec changes
Also:
- type-checking receivers
- get rid of some multiple errors at the same position

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6709061
2012-10-22 11:28:21 -07:00
Nigel Tao
eb7d56965b os: fix documentation typos: s/an array/a slice/.
R=dsymonds
CC=golang-dev
https://golang.org/cl/6736057
2012-10-22 16:26:47 +11:00
Patrick Smith
2e67dd861d encoding/xml: expand allowed entity names
Previously, multi-byte characters were not allowed. Also certain single-byte
characters, such as '-', were disallowed.
Fixes #3813.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6641052
2012-10-21 20:33:24 -04:00
Jingcheng Zhang
5d05c7800e runtime: sizeclass in MSpan should be int32.
R=golang-dev, minux.ma, dave, rsc
CC=golang-dev
https://golang.org/cl/6643046
2012-10-21 20:32:43 -04:00
Nigel Tao
80c4eac637 go/build: document the behavior of multiple build constraints.
R=rsc, pkleiweg
CC=golang-dev
https://golang.org/cl/6725052
2012-10-22 11:15:17 +11:00
Jan Ziak
4a191c2c1b runtime: store types of allocated objects
R=rsc
CC=golang-dev
https://golang.org/cl/6569057
2012-10-21 17:41:32 -04:00
Mikio Hara
4545dc6a69 net: add test for Conn, PacketConn and Listener
I just realized that there is no good place for adding
exposed function or method tests because server, unicast
and multicast_test.go do test complicated multiple test
objects, platform behaviros, protocol behaviors and API,
at the same time. Perhaps splitting them into per test
object might be better, so this CL provides tests focused
on API.

R=rsc
CC=gobot, golang-dev
https://golang.org/cl/6501057
2012-10-21 17:17:51 -04:00
Evan Shaw
772decbc80 reflect: make Index and Slice accept strings
Fixes #3284.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/6643043
2012-10-21 17:02:10 -04:00
Shenghou Ma
c1b7ddc6aa runtime: update docs for MemStats.PauseNs
PauseNs is a circular buffer of recent pause times, and the
most recent one is at [((NumGC-1)+256)%256].

   Also fix comments cross-linking the Go and C definition of
various structs.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6657047
2012-10-22 01:08:13 +08:00
Shenghou Ma
3e3fa7b5f1 runtime: ~3.7x speed up of div/mod on ARM
benchmark                      old ns/op    new ns/op    delta
BenchmarkUint32Div7                  281           75  -73.06%
BenchmarkUint32Div37                 281           75  -73.02%
BenchmarkUint32Div123                281           75  -73.02%
BenchmarkUint32Div763                280           75  -72.89%
BenchmarkUint32Div1247               280           75  -72.93%
BenchmarkUint32Div9305               281           75  -73.02%
BenchmarkUint32Div13307              281           75  -73.06%
BenchmarkUint32Div52513              281           75  -72.99%
BenchmarkUint32Div60978747           281           63  -77.33%
BenchmarkUint32Div106956295          280           63  -77.21%
BenchmarkUint32Mod7                  280           77  -72.21%
BenchmarkUint32Mod37                 280           77  -72.18%
BenchmarkUint32Mod123                280           77  -72.25%
BenchmarkUint32Mod763                280           77  -72.18%
BenchmarkUint32Mod1247               280           77  -72.21%
BenchmarkUint32Mod9305               280           77  -72.21%
BenchmarkUint32Mod13307              280           77  -72.25%
BenchmarkUint32Mod52513              280           77  -72.18%
BenchmarkUint32Mod60978747           280           63  -77.25%
BenchmarkUint32Mod106956295          280           63  -77.21%

R=dave, rsc
CC=dave, golang-dev, rsc
https://golang.org/cl/6717043
2012-10-20 16:40:19 +08:00
Nigel Tao
0ba5ec53b0 bufio: remove a little unnecessary indirection in tests.
R=mchaten, r
CC=golang-dev
https://golang.org/cl/6739045
2012-10-20 13:02:29 +11:00
Oling Cat
c117da37a2 unsafe: fix a typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6736048
2012-10-19 16:35:15 +11:00
Nigel Tao
e55fdff210 bufio: make Writer.ReadFrom not flush prematurely. For example,
many small writes to a network may be less efficient that a few
large writes.

This fixes net/http's TestClientWrites, broken by 6565056 that
introduced Writer.ReadFrom. That test implicitly assumed that
calling io.Copy on a *bufio.Writer wouldn't write to the
underlying network until the buffer was full.

R=dsymonds
CC=bradfitz, golang-dev, mchaten, mikioh.mikioh
https://golang.org/cl/6743044
2012-10-19 16:32:00 +11:00
Michael Chaten
2a4818dd11 bufio: Implement io.ReaderFrom for (*Writer).
This is part 2 of 2 for issue 4028.

benchmark                        old ns/op    new ns/op    delta
BenchmarkWriterCopyOptimal           53293        28326  -46.85%
BenchmarkWriterCopyUnoptimal         53757        30537  -43.19%
BenchmarkWriterCopyNoReadFrom        53192        36642  -31.11%

Fixes #4028.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6565056
2012-10-19 11:22:51 +11:00
Nigel Tao
90ad6a2d11 runtime: update comment for the "extern register" variables g and m.
R=rsc, minux.ma, ality
CC=dave, golang-dev
https://golang.org/cl/6620050
2012-10-19 11:02:32 +11:00
Nigel Tao
5abf4bdc27 image/draw: fast-path for 4:4:0 chroma subsampled sources.
R=r
CC=golang-dev
https://golang.org/cl/6699049
2012-10-19 10:55:41 +11:00
Ian Lance Taylor
1e6d9f49da encoding/xml: correctly escape newline, carriage return, and tab
The generated encodings are those from
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping

The change to the decoder ensures that we turn 
 in the
input into \r, not \n.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6747043
2012-10-18 13:40:45 -07:00
Rémy Oudompheng
2abaaefa72 image/jpeg: make TestDCT faster.
The value of cosines are cached in a global array
instead of being recomputed each time.
The test was terribly slow on arm.

R=golang-dev, dave, nigeltao
CC=golang-dev
https://golang.org/cl/6733046
2012-10-18 21:28:04 +02:00