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

798 Commits

Author SHA1 Message Date
Rob Pike
a6e1ad2733 two easy optimizations for regexp:
1) if char class contains a single character, make it a single character.
		(this is used to quote, e.g. [.] rather than \.
	2) if regexp begins with ordinary text substring, use plain string match to start engine

R=rsc
CC=golang-dev
https://golang.org/cl/157095
2009-11-19 16:45:50 -08:00
Robert Griesemer
b48f71213a Permit omission of hi bound in slices.
R=r, rsc
https://golang.org/cl/157082
2009-11-19 16:42:05 -08:00
Trevor Strohman
61660adc63 Adds benchmark support to gotest.
No benchmarks are run unless the --benchmarks=<regexp> flag
is specified on the gotest command line.  This change includes
sample benchmarks for regexp.

% gotest --benchmarks=.*
(standard test output redacted)
testing.BenchmarkSimpleMatch	200000	      7799 ns/op
testing.BenchmarkUngroupedMatch	20000	     76898 ns/op
testing.BenchmarkGroupedMatch	50000	     38148 ns/op

R=r, rsc
https://golang.org/cl/154173
2009-11-19 16:35:34 -08:00
Russ Cox
69039e5a5a build Make.deps during make.bash instead
of keeping a checked-in copy.  doesn't
slow down make.bash appreciably.

R=r
https://golang.org/cl/156099
2009-11-19 16:27:13 -08:00
Rob Pike
4e201c7f20 os.ReadAt doesn't return EOF at EOF.
thanks to lionkov for the fix.

Fixes #262.

R=rsc
CC=golang-dev
https://golang.org/cl/156097
2009-11-19 11:51:23 -08:00
Russ Cox
4aaf948f90 runtime: mask signals during signal handler on OS X
Fixes #265.

R=r
CC=golang-dev
https://golang.org/cl/157084
2009-11-19 11:01:16 -08:00
Rob Pike
02df7db868 replace custom findByte with bytes.IndexByte
R=rsc
https://golang.org/cl/156093
2009-11-18 19:58:32 -08:00
Adam Langley
bf1f63a273 big: fix large division.
I missed a case.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/156092
2009-11-18 19:26:12 -08:00
Rob Pike
8c1a627e5c add bytes.IndexByte; common case we can make fast later.
also pick off the special case in strings.Index.   don't want strings.IndexByte
because the call site will very rarely need to allocate and we can handle the
test in the code itself.   bytes.IndexByte can avoid a common allocation.

R=rsc
CC=golang-dev
https://golang.org/cl/156091
2009-11-18 19:23:08 -08:00
Russ Cox
e1c5c3df77 runtime: fix bug on darwin/amd64 - bad g in bsdthread_start
R=r
https://golang.org/cl/157077
2009-11-18 18:17:11 -08:00
Devon H. O'Dell
60b1a17b9e More FreeBSD-touchups. Thundercats are GOOOOO!
R=rsc
CC=golang-dev
https://golang.org/cl/157074
2009-11-18 16:51:59 -08:00
Adam Langley
eac41e7eba crypto/x509: RawContents -> RawContent
TBR=rsc

R=rsc
https://golang.org/cl/157075
2009-11-18 16:38:30 -08:00
Adam Langley
3ab331ed29 asn1: add support for RawContent
R=rsc
CC=golang-dev
https://golang.org/cl/157056
2009-11-18 16:32:44 -08:00
Adam Langley
cc56fc3860 crypto/x509: add certificate support.
R=rsc
CC=golang-dev
https://golang.org/cl/156054
2009-11-18 16:08:24 -08:00
Rob Pike
e70cedfaec remove bytes.Copy
replace all calls with calls to copy
use copy in regexp and bytes.Buffer

R=rsc
CC=golang-dev
https://golang.org/cl/157073
2009-11-18 15:24:24 -08:00
Rob Pike
093493c6a5 bugs in memmove:
- has arguments (no stack split)
	- MOVL does not set condition

R=ken2, rsc
https://golang.org/cl/156086
2009-11-18 15:00:02 -08:00
Adam Langley
ef8f483c60 net: remove race condition on Close.
Previously a netFd could be queued for reading/writing in the channel,
but close(2)'ed before pollServer got to it. In this case, the kernel
would consider the descriptor closed and the attempt to add it to the
epoll set would fail and panic.

This patch makes Close a roundtrip to the pollServer, although the
actual close(2) still occurs elsewhere to avoid blocking the
pollServer.

Fixes #143.

R=rsc
CC=golang-dev
https://golang.org/cl/152130
2009-11-18 13:18:34 -08:00
Russ Cox
a274099340 big: implement 386 assembly routines
7x speedup on big and crypto/rsa unit tests.
also dropped useAsm in favor of making the
asm stubs jump to the Go versions.

R=agl1
CC=golang-dev, gri
https://golang.org/cl/157062
2009-11-18 09:54:51 -08:00
William Josephson
4c0f262a2d Remove unnecessary execute bits.
R=rsc
https://golang.org/cl/156077
2009-11-18 09:19:29 -08:00
Devon H. O'Dell
659780b643 Add an intptr type to runtime; needed in FreeBSD
In thread.c, we need to cast to whatever the native
size of intptr is on the system, but we only have
uintptr available. They're the same size, but can't
do signed casts without this one :).

R=rsc
CC=golang-dev
https://golang.org/cl/156073
2009-11-18 09:11:39 -08:00
Devon H. O'Dell
b3f538a4fd FreeBSD/i386 work
This patchset gets Go to pretty much the same state that
FreeBSD/amd64 is in.

R=rsc
https://golang.org/cl/157055
2009-11-17 23:58:51 -08:00
Russ Cox
744d5ae48a runtime: add ARM memmove
R=ken2
https://golang.org/cl/156063
2009-11-17 22:54:20 -08:00
Russ Cox
ed0beea27b copy tweaks
* move memmove to arch-specific subdirectories
  * add memmove for arm
  * add copyright notices marking them as copied from Inferno

R=ken2
https://golang.org/cl/156061
2009-11-17 22:16:55 -08:00
Rob Pike
ea5cc6c021 add a test for %+v in nested structures.
threw in an embedded one for good measure.

R=rsc
CC=golang-dev
https://golang.org/cl/157058
2009-11-17 22:14:34 -08:00
Russ Cox
41554e2528 runtime: two trivial but important bug fixes
R=r
https://golang.org/cl/156059
2009-11-17 22:00:30 -08:00
Ken Thompson
948f3e77e1 bug in copy
R=rsc
https://golang.org/cl/156056
2009-11-17 20:44:35 -08:00
Ken Thompson
c4606d05da install copy predefined
did not test 386, but should work
shouldnt matter if copy is not used

R=rsc
https://golang.org/cl/156055
2009-11-17 20:41:44 -08:00
Adam Langley
a8ba40823c crypto/rsa: add PKCS#1 v1.5 signature support.
R=rsc
CC=golang-dev
https://golang.org/cl/156051
2009-11-17 18:21:47 -08:00
Adam Langley
80b7f6a8d4 asn1:
* add Marshal
  * add BitString.RightAlign
  * change to using a *time.Time (from time.Time) since that's what
    the time package uses.
  * return the unparsed data from Unmarshal.

R=rsc
CC=golang-dev
https://golang.org/cl/156047
2009-11-17 18:09:41 -08:00
Russ Cox
1dbd3c8d3d reflect: document that PkgPath and Name return
empty string for unnamed types.

Fixes #249.

R=r
https://golang.org/cl/156052
2009-11-17 16:03:14 -08:00
Russ Cox
849e6f99b8 http: do not crash accessing r.Form if ParseForm fails
Fixes #233.

R=dsymonds1
https://golang.org/cl/154179
2009-11-17 14:45:10 -08:00
Russ Cox
4dfd7fdde5 runtime: do not create new threads during malloc.
the signal handling stack is a different size than
	the normal stack, so it cannot be allocated using
	the backup stack allocator.

Fixes #250.

R=agl1
CC=golang-dev
https://golang.org/cl/157044
2009-11-17 14:42:08 -08:00
Rob Pike
6240b0110a improve documentation of runtime. there was no mention of types.
R=rsc
CC=golang-dev
https://golang.org/cl/157042
2009-11-17 11:44:15 -08:00
Aron Nopanen
c51ee432d1 Make non-errored RPC calls return 'nil' error to caller.
Error information is carried from RPC server to client in the string
'Error' field of rpc.Response. An empty string is sent in the success
case. This empty string was being returned to the caller (of Client.Call
or Client.Go), resulting in a non-nil error response.

This change detects an empty-string Response.Error at the client, and
translates it into a nil value in Call.Error.

Tests updated to check error return in success cases.

R=r, rsc
https://golang.org/cl/154159
2009-11-17 11:29:02 -08:00
Russ Cox
b4586a7429 math: fix argument names in Atan2
(error introduced converting from arg1, arg2)

Fixes #220.

R=r
https://golang.org/cl/156041
2009-11-17 08:39:56 -08:00
Russ Cox
6e788e0f0f net: enforce timeouts for ReadFrom/WriteTo
Fixes #153.

R=r
https://golang.org/cl/154177
2009-11-17 08:39:17 -08:00
Russ Cox
a65bf95dd8 syscall: use correct pointer in recvfrom/sendto.
linux/386 stack trace: use 32-bit hex.

Fixes #159.

R=r
https://golang.org/cl/154178
2009-11-17 08:39:04 -08:00
Devon H. O'Dell
0489a260da FreeBSD-specific porting work.
cgo/libmach remain unimplemented. However, compilers, runtime,
and packages are 100%. I still need to go through and implement
missing syscalls (at least make sure they're all listed), but
for all shipped functionality, this is done. Ship! ;)

R=rsc, VenkateshSrinivas
https://golang.org/cl/152142
2009-11-17 08:20:58 -08:00
Rob Pike
30b1b9a36a Rework gobs to fix bad bug related to sharing of id's between encoder and decoder side.
Fix is to move all decoder state into the decoder object.

Fixes #215.

R=rsc
CC=golang-dev
https://golang.org/cl/155077
2009-11-16 23:32:30 -08:00
Rob Pike
50c04132ac fix bug causing empty strings to be become non-nil errors on client side of rpc connection.
R=rsc
CC=golang-dev
https://golang.org/cl/155078
2009-11-16 23:32:16 -08:00
Russ Cox
597b2a91a6 runtime: make signal handler work on 386
R=r
https://golang.org/cl/154171
2009-11-16 17:51:47 -08:00
Adam Langley
1cdfe9fa28 unsafe: documentation typo.
Fixes #236.

R=r
CC=golang-dev
https://golang.org/cl/155072
2009-11-16 15:39:04 -08:00
David Symonds
affcfe5a75 Add some primitive type aliases to exp/iterable and define Iter on them.
R=rsc
https://golang.org/cl/155065
2009-11-16 13:39:59 -08:00
David G. Andersen
37f71e8ad6 An asked-for-in #go-nuts extension to quickly create a repeated
copy of a string or a byte array.
        strings.Repeat("-", 50)
	bytes.Repeat(b, 99)

R=rsc
https://golang.org/cl/155063
2009-11-16 12:40:01 -08:00
Adam Langley
391e082ca9 crypto/md5: fix comment typo.
Fixes #210.

R=rsc
CC=golang-dev
https://golang.org/cl/155057
2009-11-15 14:00:46 -08:00
Russ Cox
091191336a runtime: avoid crash in Caller
Fixes #176.

R=r
https://golang.org/cl/154146
2009-11-15 12:57:15 -08:00
Russ Cox
a338231526 gc: five bug fixes, one better error.
* check for struct literal assignment to private fields.
* record, fix crash involving parallel map assignment.
* avoid infinite recursion in exportassignok.
* make floating point bounds check precise.
* avoid crash on invalid receiver.

* add context to error about implicit assignment.

Fixes #86.
Fixes #88.
Fixes #158.
Fixes #174.
Fixes #201.
Fixes #204.

R=ken2
https://golang.org/cl/154144
2009-11-15 12:57:09 -08:00
Russ Cox
a967f57d19 http.URLEscape: escape all bytes required by RFC 2396
Fixes #125.

R=r
https://golang.org/cl/154143
2009-11-15 12:56:50 -08:00
Rob Pike
27779dd6cb fix bug in bytes.Map and add test cases for Map in both strings and bytes packages.
thanks to ulrik.sverdrup for the test case.

Fixes #191.

R=rsc
CC=golang-dev
https://golang.org/cl/155056
2009-11-15 12:07:27 -08:00
Adam Langley
ad05d29103 crypto/rsa: handle the case of non-coprime blinds.
We are dealing with the multiplicative group ℤ/pqℤ. Multiples of
either p or q are not members of the group since they cannot have an
inverse. (Such numbers are 0 in the subgroup ℤ/pℤ.)

With p and q of typical size (> 512 bits), the probability of a random
blind [1..pq-1] being a multiple of p or q is negligible. However, in
the unit tests, much smaller sizes are used and the event could occur.

This change checks the result of the ext GCD and deals with this case.

It also increases the size of p and q in the unit test as a large
number of the keys selected were p, q = 227,169.

R=rsc
CC=golang-dev
https://golang.org/cl/154141
2009-11-14 20:38:00 -08:00