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

3351 Commits

Author SHA1 Message Date
Russ Cox
1fddbab736 5l: fix softfloat nits
Need to load math.a so that sqrtGoC is available.
Also was missing prototype.

R=ken2
CC=golang-dev
https://golang.org/cl/4517148
2011-06-09 18:38:25 -04:00
Fan Hongjian
fc41e621e8 math: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation
5a: add SQRTF and SQRTD
5l: add ASQRTF and ASQRTD

Use ARMv7 VFP VSQRT instruction to speed up math.Sqrt

R=rsc, dave, m
CC=golang-dev
https://golang.org/cl/4551082
2011-06-09 17:19:08 -04:00
Quan Yong Zhai
439694125f runtime: improve memmove
check memory overlap

R=rsc, r, ken, edsrzf
CC=golang-dev
https://golang.org/cl/4602047
2011-06-09 16:49:47 -04:00
Alex Brainman
c3be760889 runtime: increase maximum number of windows callbacks
Fixes #1912.

R=rsc
CC=golang-dev
https://golang.org/cl/4591047
2011-06-09 10:29:25 +10:00
David Symonds
ffd01f2a47 mail: decode "Q"-encoded mail addresses.
Supports ISO-8859-1 and UTF-8.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4568064
2011-06-09 10:18:36 +10:00
Nigel Tao
833529fd6f compress/lzw: reduce decoder buffer size from 3*4096 to 2*4096.
This happens to speed up the decoder benchmarks by 50% on my computer
(GOARCH=amd64 GOOS=linux), but I don't have a good intuition as to why.
For example, just adding an unused [4096]byte field to the decoder
struct doesn't significantly change the numbers.

Before:

lzw.BenchmarkDecoder1e4	    5000	    488057 ns/op	  20.49 MB/s
lzw.BenchmarkDecoder1e5	     500	   4613638 ns/op	  21.67 MB/s
lzw.BenchmarkDecoder1e6	      50	  45672260 ns/op	  21.90 MB/s
lzw.BenchmarkEncoder1e4	    5000	    353563 ns/op	  28.28 MB/s
lzw.BenchmarkEncoder1e5	     500	   3431618 ns/op	  29.14 MB/s
lzw.BenchmarkEncoder1e6	      50	  34009640 ns/op	  29.40 MB/s

After:

lzw.BenchmarkDecoder1e4	    5000	    339725 ns/op	  29.44 MB/s
lzw.BenchmarkDecoder1e5	     500	   3166894 ns/op	  31.58 MB/s
lzw.BenchmarkDecoder1e6	      50	  31317260 ns/op	  31.93 MB/s
lzw.BenchmarkEncoder1e4	    5000	    354909 ns/op	  28.18 MB/s
lzw.BenchmarkEncoder1e5	     500	   3432710 ns/op	  29.13 MB/s
lzw.BenchmarkEncoder1e6	      50	  34010500 ns/op	  29.40 MB/s

R=rsc, r
CC=golang-dev
https://golang.org/cl/4535123
2011-06-09 09:50:38 +10:00
Brad Fitzpatrick
9c436ab7dc http: fix handling of 0-lengthed http requests
Via Russ Ross' bug report on golang-nuts, it was not possible
to send an HTTP request with a zero length body with either a
Content-Length (it was stripped) or chunking (it wasn't set).

This means Go couldn't upload 0-length objects to Amazon S3.
(which aren't as silly as they might sound, as S3 objects can
have key/values associated with them, set in the headers)

Amazon further doesn't supported chunked uploads. (not Go's
problem, but we should be able to let users set an explicit
Content-Length, even if it's zero.)

To fix the ambiguity of an explicit zero Content-Length and
the Request struct's default zero value, users need to
explicit set TransferEncoding to []string{"identity"} to force
the Request.Write to include a Content-Length: 0.  identity is
in RFC 2616 but is ignored pretty much everywhere.  We don't
even then serialize it on the wire, since it's kinda useless,
except as an internal sentinel value.

The "identity" value is then documented, but most users can
ignore that because NewRequest now sets that.

And adds more tests.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4603041
2011-06-08 15:59:23 -07:00
Brad Fitzpatrick
6a876283c8 http: change most map[string][]string types to new Values type
This replaces most the map[string][]string usage with
a new Values type name, with the usual methods.

It also changes client.PostForm to take a Values, rather
than a map[string]string, closing a TODO in the code.

R=rsc
CC=golang-dev
https://golang.org/cl/4532123
2011-06-08 13:38:20 -07:00
Robert Griesemer
2de06655f1 big: removed some gratuitous +/-1's
R=mtj, bradfitz
CC=golang-dev
https://golang.org/cl/4584046
2011-06-08 11:24:24 -07:00
Robert Griesemer
a609a6bb63 ebnf: follow EBNF for EBNF faithfully
Apply analogous changes in godoc/spec.go.

Fixes #1829.

R=nmessenger, r
CC=golang-dev
https://golang.org/cl/4528127
2011-06-08 09:10:30 -07:00
Robert Griesemer
21032ebebd big: gobs for big rats
Fixes #1926.

R=r
CC=golang-dev
https://golang.org/cl/4550122
2011-06-08 09:10:01 -07:00
Yuval Pavel Zholkover
6c746328f7 os: fix Getenv for Plan 9. Truncate the rightmost char if it is '\0'.
R=mirtchovski, ality, taruti, rsc
CC=golang-dev
https://golang.org/cl/4386046
2011-06-08 09:44:03 -04:00
Jonathan Mark
ddde52ae56 runtime: SysMap uses MAP_FIXED if needed on 64-bit Linux
This change was adapted from gccgo's libgo/runtime/mem.c at
Ian Taylor's suggestion.  It fixes all.bash failing with
"address space conflict: map() =" on amd64 Linux with kernel
version 2.6.32.8-grsec-2.1.14-modsign-xeon-64.
With this change, SysMap will use MAP_FIXED to allocate its desired
address space, after first calling mincore to check that there is
nothing else mapped there.

R=iant, dave, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/4438091
2011-06-07 21:50:10 -07:00
David Symonds
5c32c96f5c mail: format addresseses correctly.
Also remove an obsolete TODO while I'm here.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4588041
2011-06-08 13:32:47 +10:00
Michael T. Jones
d5c45c541d big.nat: Improved speed of nat-to-string conversion
Three optimizations: First, special-case power of two bases
that partion a Word(), bases 2, 4, 16, and 256. These can
be moved directly from internal Word() storage to the output
without multiprecision operations. Next, same approach for
the other power-of-two bases, 8, 32, 64, and 128. These
don't fill a Word() evenly, so special handling is needed
for those cases where input spans the high-bits of one Word
and the low bis of the next one.  Finally, implement the
general case for others bases in 2 <= base <= 256 using
superbases, the largest power of base representable in a
Word(). For base ten, this is 9 digits and a superbase of
10^9 for 32-bit Words and 19 digits and 10^19 for 64-bit
compiles. This way we do just 1/9th or 1/19th of the expensive
multiprecision divisions, unpacking superdigits using fast
native machine arithmetic. The resulting code runs 7x to
800x the speed of the previous approach, depending on the
length of the number to be converted--longer is relatively
faster.

Also, extended the tests and benchmarks for string to nat
(scan()) and nat to string (string()) functions. A further
enhancement awaits the next CL to make general cases about
7x faster for long cases.

R=gri
CC=golang-dev
https://golang.org/cl/4595041
2011-06-07 16:02:34 -07:00
Brad Fitzpatrick
29e4775cd5 exec: export the underlying *os.Process in Cmd
R=rsc
CC=golang-dev
https://golang.org/cl/4579044
2011-06-07 13:17:34 -07:00
Mikio Hara
a8fd374187 net: fix bug in net.Interfaces: handle elastic sdl_data size correctly
Fixes #1921.

R=golang-dev, jeff
CC=golang-dev
https://golang.org/cl/4535120
2011-06-07 16:06:36 -04:00
Russ Cox
63dae3c3be compress/lzw: do not use background goroutines
Programs expect that Read and Write are synchronous.
The background goroutines make the implementation
a little easier, but they introduce asynchrony that
trips up calling code.  Remove them.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/4548080
2011-06-07 14:37:06 -04:00
Robert Hencke
8cd7aac223 godefs: do not assume forward type references are enums
Fixes #1466.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/4564043
2011-06-07 14:28:10 -04:00
Rob Pike
f2f3b8fa99 strconv: change Quote to be Unicode-friendly,
add QuoteToASCII.
The Quote and QuoteRune functions now let printable
runes (as defined by unicode.IsPrint) through.  When
true 7-bit clean stuff is necessary, there are now two
new functions: QuoteToASCII and QuoteRuneToASCII.

Printf("%q") uses Quote. To get the old behavior, it
will now be necessary to say
        Printf("%s", strconv.QuoteToASCII(s))
but that should rarely be necessary.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4561061
2011-06-07 12:23:08 +00:00
Rob Pike
05348ab0c8 image/gif: fix buglet in graphics extension.
need to ReadFull, not Read, to get extension data.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4576043
2011-06-07 12:19:36 +00:00
Brad Fitzpatrick
5e03143c1a html: improve attribute parsing, note package status
Fixes #1890

R=nigeltao
CC=golang-dev
https://golang.org/cl/4528102
2011-06-06 15:56:15 -07:00
Rob Pike
9e857dbdcc template: rearrange the code into separate files.
The single file was getting unwieldy.
Also remove use of vector; a slice works fine - although
it's an unusual one.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/4576042
2011-06-06 21:33:02 +00:00
Graham Miller
f35a3df80c big: Rat always outputs the requested precision from FloatString
Fixes #1922.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4551098
2011-06-06 12:59:58 -07:00
Adam Langley
c281ddf1eb crypto: reorg, cleanup and add function for generating CRLs.
This change moves a number of common PKIX structures into
crypto/x509/pkix, from where x509, and ocsp can reference
them, saving duplication. It also removes x509/crl and merges it into
x509 and x509/pkix.

x509 is changed to take advantage of the big.Int support that now
exists in asn1. Because of this, the public/private key pair in
http/httptest/server.go had to be updated because it was serialised
with an old version of the code that didn't zero pad ASN.1 INTEGERs.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4532115
2011-06-06 10:35:46 -04:00
Evan Shaw
94b974a22d os: add Process.Kill and Process.Signal
R=alex.brainman, r, rsc, krasin, iant, rsc, r
CC=golang-dev
https://golang.org/cl/4437091
2011-06-06 19:53:30 +10:00
David Jakob Fritz
ce877acf31 netchan: added drain method to importer.
Fixes #1868.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4550093
2011-06-06 06:55:32 +00:00
David Symonds
ff0198b72f mail: address list parsing.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4547084
2011-06-06 16:46:14 +10:00
Andrew Gerrand
a028a02395 crypto/twofish: fix Reset index overflow bug.
Fixes #1919.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4530110
2011-06-06 14:30:48 +10:00
Benny Siegert
d01b260e78 image/tiff: support for bit depths other than 8.
At the moment, 16-bit samples are reduced to 8 bits, this will
be changed in a separate CL.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4552057
2011-06-06 14:11:29 +10:00
Alex Brainman
4c2123e534 go/build: fix windows build by commenting out references to stdout and stderr in cgotest
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/4561062
2011-06-06 10:11:41 +10:00
Andrew Gerrand
eb72403bb6 go/build: exclude cgo test from arm
go/build: include command output in error values
go/build: add syslist.go to .hgignore

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4550118
2011-06-06 09:25:30 +10:00
Nigel Tao
b47a38dedb image/draw: move exp/draw to image/draw and exp/gui.
R=r
CC=golang-dev
https://golang.org/cl/4515191
2011-06-05 14:27:38 +10:00
Andrew Gerrand
c2cea4418a go/build: new package for building go programs
R=rsc
CC=golang-dev
https://golang.org/cl/4433047
2011-06-04 12:45:09 +10:00
Rob Pike
7a92287a48 unicode: for consistency with MaxRune, s/Latin1Max/MaxLatin1/ and
s/ASCIIMax/MaxASCII/

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/4539109
2011-06-04 09:28:27 +10:00
Rob Pike
8d64e73f94 unicode: add the first few property tests for printing.
The long-term goal is that %q will use IsPrint to decide
what to show natively vs. as hexadecimal.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4526095
2011-06-04 07:46:22 +10:00
Robert Griesemer
86b3577a59 ebnf: update comment
(pointed out by jan.mercl@nic.cz)

R=iant, jan.mercl, rsc
CC=golang-dev
https://golang.org/cl/4515189
2011-06-03 13:02:35 -07:00
Brad Fitzpatrick
2655757900 http: don't fail on accept hitting EMFILE
Fixes #1891

R=rsc
CC=golang-dev
https://golang.org/cl/4550112
2011-06-03 12:23:50 -07:00
Mikio Hara
0015e8eb5e net: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/4539108
2011-06-03 15:16:05 -04:00
Mikio Hara
518331dfea net: add network interface identification API
This CL introduces new API into package net to identify the network
interface.  A functionality of new API is very similar to RFC3493 -
"Interface Identification".

R=r, gri, bradfitz, robert.hencke, fullung, rsc
CC=golang-dev
https://golang.org/cl/4437087
2011-06-03 14:35:42 -04:00
Dmitriy Vyukov
79b397b27e testing: check that tests and benchmarks do not affect GOMAXPROCS
Plus fix spoiling of GOMAXPROCS in 2 existing rwmutex tests.
Plus fix benchmark output to stdout (now it outputs to stderr like all other output).

R=rsc
CC=golang-dev
https://golang.org/cl/4529111
2011-06-03 13:50:44 -04:00
Nigel Tao
f531ef3279 image: rename Contains and ContainsRectangle to In.
R=r
CC=golang-dev
https://golang.org/cl/4539104
2011-06-03 13:18:15 +10:00
Luuk van Dijk
56668283f1 gc: allow tags on parameters in export section of object files.
This is in preparation of escape analysis; function parameters
can now be tagged with interesting bits by the compiler by
assigning to n->note.

tested by having typecheck put a fake tag on all parameters of
pointer type and compiling the tree.

R=rsc
CC=golang-dev
https://golang.org/cl/4524092
2011-06-03 03:54:56 +02:00
Nigel Tao
ae5a972d9e exp/draw: fix clipping bug where sp/mp were not shifted when r.Min was.
image: add Rectangle.ContainsRectangle method.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4517130
2011-06-03 11:43:54 +10:00
Rob Pike
ce5c1cf036 fmt: fix bug in UnreadRune: must clear memory of previous
rune if input implements UnreadRune; otherwise the lookahead
will lie.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4548082
2011-06-03 07:53:50 +10:00
Rob Pike
4e9e925002 exec: change exec.PathError to exec.Error
There were two issues:
1) It might not be a path error, it might be 'permission denied'.
2) The concept of $PATH is Unix-specific.

R=alex.brainman, rsc, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4530096
2011-06-03 07:48:06 +10:00
Brad Fitzpatrick
31c79c4eff http: ServeFile shouldn't send Content-Length when Content-Encoding is set
Fixes #1905

R=rsc
CC=golang-dev
https://golang.org/cl/4538111
2011-06-02 13:36:52 -07:00
Robert Griesemer
5bf57c1b41 big: remove some unnecessary conversions
R=rsc
CC=golang-dev
https://golang.org/cl/4529110
2011-06-02 12:58:26 -07:00
Brad Fitzpatrick
2a8ea0d1b5 http: catch panics
R=rsc
CC=golang-dev
https://golang.org/cl/4559067
2011-06-02 12:00:26 -07:00
Robert Griesemer
191a6bfc5e big: do not modify divisor
Fixes #1907.

R=rsc
CC=golang-dev
https://golang.org/cl/4527096
2011-06-02 11:07:41 -07:00