Commit Graph

3905 Commits

Author SHA1 Message Date
Robert Griesemer
90d0c3316c big: bug fix for division
Fixes #784.

R=rsc
CC=golang-dev
https://golang.org/cl/1196043
2010-05-18 16:31:49 -07:00
Kyle Consalus
2db47c9083 Trivial optimization.
Cached string indexing in inner loop of Btoui64.

    Before:
    strconv_test.BenchmarkAtoi   5000000           309 ns/op
    strconv_test.BenchmarkAtoiNeg    5000000           325 ns/op
    strconv_test.BenchmarkAtoi64     5000000           465 ns/op
    strconv_test.BenchmarkAtoi64Neg  5000000           469 ns/op

    After:
    strconv_test.BenchmarkAtoi  10000000           182 ns/op
    strconv_test.BenchmarkAtoiNeg   10000000           193 ns/op
    strconv_test.BenchmarkAtoi64    10000000           251 ns/op
    strconv_test.BenchmarkAtoi64Neg 10000000           258 ns/op

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1227042
2010-05-18 16:29:24 -07:00
Roger Peppe
bcdcf395e5 Add Error member to yyLexer type (yyError
has no access to yylex)

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/813047
2010-05-17 12:23:48 -07:00
Robert Griesemer
dbb6232724 big: implemented format support for fmt library, MulRange
- support for binary prefix 0b (to match fmt.Format)
- renamed nat.new -> nat.setUint64 for consistency
- more tests

R=r
CC=golang-dev
https://golang.org/cl/1233041
2010-05-15 10:23:41 -07:00
Christopher Wedgwood
cffdb1e830 build; allow MAKEFLAGS to be set outside the build scripts
R=rsc, r
CC=golang-dev
https://golang.org/cl/1231041
2010-05-15 10:08:29 -07:00
Charles L. Dorian
1d4e2d1adc cmath: add package description
Also update range of Phase and Polar due to signed zero.
[Phase(cmplx(-1, +0)) = pi and Phase(cmplx(-1, -0)) = -pi]

R=rsc, r
CC=golang-dev
https://golang.org/cl/1235041
2010-05-15 10:06:54 -07:00
Robert Griesemer
31f79690f7 gofmt: exclude test w/ illegal syntax from test cases
R=adg
CC=golang-dev
https://golang.org/cl/1228041
2010-05-14 15:45:53 -07:00
Robert Griesemer
650cc32739 go/printer (gofmt): don't lose mandatory semicolons
Fixes #779.

R=r
CC=golang-dev
https://golang.org/cl/1218042
2010-05-14 15:38:25 -07:00
Roger Peppe
14e04f4d40 Prevent Printf crashing when giving an extra nil argument.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1195041
2010-05-13 12:49:48 -07:00
Robert Griesemer
d6acc0646b http: prevent crash if remote server is not responding with "HTTP/"
Fixes #775.

R=rsc
CC=golang-dev
https://golang.org/cl/1180042
2010-05-11 16:50:20 -07:00
Russ Cox
75dbbd2137 netchan: be less chatty during gotest
R=r
CC=golang-dev
https://golang.org/cl/1186041
2010-05-11 14:57:08 -07:00
Russ Cox
4e5bc6a8fe json: fix array -> non-array decoding
Fixes #773.

R=adg
CC=golang-dev
https://golang.org/cl/1120042
2010-05-11 14:38:55 -07:00
Nigel Tao
916426ea76 drawGlyphOver optimization.
Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.

R=r
CC=golang-dev
https://golang.org/cl/1179041
2010-05-11 13:35:16 +10:00
Nigel Tao
d7a6d22852 exp/draw fast path for glyph images.
To draw.Draw a 32x32 image.Alpha 10000 times,
Before: 633ms with 10000 mallocs
After: 49ms with 0 mallocs

These times are just blitting an image.Alpha, and do not include
rasterizing a glyph's vector contours to an image.Alpha.

The "generic" test case in draw_test.go tests this fast path.

R=rsc
CC=golang-dev
https://golang.org/cl/1122043
2010-05-10 10:32:08 +10:00
Rob Pike
b717768b94 template: regularize the handling of interfaces, pointers, and
methods when looking up names.
Fixes #764.

R=rsc
CC=golang-dev
https://golang.org/cl/1170041
2010-05-09 16:40:38 -07:00
Michael Hoisie
834abb8068 json: accept escaped slash in string scanner
R=rsc
CC=golang-dev
https://golang.org/cl/1173041
2010-05-08 17:34:05 -07:00
Robert Griesemer
52cc058172 big: cleanups and performance tuning
- removed last argument (n) from all core arithmetic routines;
  instead, use the length of the result

- simplified nat.make implementation and chose a better capacity
  for new values, removed a TODO in the process

Changing the constant e from 1 (old) to 4 (new) improved
pidigits -s -n 10000 by ~9% (on a 3.06GHz Intel Core 2 Duo):

user	0m3.882s (old)
user	0m3.549s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/1133043
2010-05-08 13:52:36 -07:00
Robert Griesemer
61eb0e71f2 big: more cleanup
- pass []Word instead of *Word to core arithmetic functions
- remove dead code

R=rsc
CC=golang-dev
https://golang.org/cl/1154042
2010-05-07 18:26:31 -07:00
Rob Pike
f023e859cf compress: renamings.
NewDeflater -> NewWriter
NewInflater -> NewReader
Deflater -> Compressor
Inflater -> Decompressor

R=rsc
CC=golang-dev
https://golang.org/cl/1166041
2010-05-07 14:32:34 -07:00
Rob Pike
b541921b66 gob: bug fix: errors encoding the payload were not
returned to caller.

R=rsc
CC=golang-dev
https://golang.org/cl/1164041
2010-05-07 13:30:13 -07:00
Rob Pike
56c5710b38 gob: add an internal commentary example showing how the
values are encoded for transmission.

R=rsc
CC=golang-dev
https://golang.org/cl/1146041
2010-05-07 11:44:41 -07:00
Ian Lance Taylor
e1b47159ab Save the scheduling state even predawn.
This permits cgo callbacks to work when run in init code.
Otherwise cgocallback switches to the wrong stack address.

R=rsc
CC=golang-dev
https://golang.org/cl/1123043
2010-05-06 22:07:03 -07:00
Robert Griesemer
6d7583d5fd fix build (typo in arith_386.s)
R=rsc
CC=golang-dev
https://golang.org/cl/1139042
2010-05-06 19:16:26 -07:00
Robert Griesemer
3f287b5002 big: implemented overlap-tolerant shifts in assembly
- no need to make copies in cases of aliases
- removed deprecated internal shift functions
- minor unrelated simplifications

This change improves pidigits -s -n10000 by almost 20%:

user 0m6.156s (old)
user 0m4.999s (new)

(pidigits -s -n20000 goes from ~25s to ~19s)

R=rsc
CC=golang-dev
https://golang.org/cl/1149041
2010-05-06 18:20:01 -07:00
Rob Pike
eb48bfbbda runtime.GOMAXPROCS: hack it to have it return the old value.
R=rsc
CC=golang-dev
https://golang.org/cl/1140041
2010-05-06 11:50:47 -07:00
Rob Pike
9088f9f245 gob: add test for indirect maps, slices, arrays.
fix a bug in the handling of indirect maps.

R=rsc
CC=golang-dev
https://golang.org/cl/1132042
2010-05-06 10:45:18 -07:00
Russ Cox
6dbba67214 gc: distinguish array, slice literal in error messages
R=ken2
CC=golang-dev
https://golang.org/cl/1138041
2010-05-06 09:34:12 -07:00
Nigel Tao
20ba090978 Make exp/draw/x11 respect $XAUTHORITY.
R=rsc, cw, nigeltao_golang
CC=golang-dev
https://golang.org/cl/1134041
2010-05-06 18:41:42 +10:00
Rob Pike
7861da737e gob: add support for maps.
Because maps are mostly a hidden type, they must be
implemented using reflection values and will not be as
efficient as arrays and slices.

R=rsc
CC=golang-dev
https://golang.org/cl/1127041
2010-05-05 16:46:39 -07:00
Rob Pike
46152bb9fe pkg/Makefile: add netchan to standard package list
R=golang-dev
CC=golang-dev
https://golang.org/cl/1121041
2010-05-05 15:17:26 -07:00
Kyle Consalus
24bfd652ee Conversion from loop to copy().
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1072041
2010-05-05 09:57:53 -07:00
Conrad Meyer
5789c86fc0 Fix a typo in net/unixsock
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1113041
2010-05-05 09:55:11 -07:00
Ken Thompson
a3a0a5fdc3 allow data statements for simple
external variable assignements.

R=rsc
CC=golang-dev
https://golang.org/cl/1094041
2010-05-03 22:51:30 -07:00
Robert Griesemer
b9caa4ac56 big: completed set of Int division routines & cleanups
- renamed Len -> BitLen, simplified implementation
- renamed old Div, Mod, DivMod -> Que, Rem, QuoRem
- implemented Div, Mod, DivMod (Euclidian definition, more
  useful in a mathematical context)
- fixed a bug in Exp (-0 was possible)
- added extra tests to check normalized results everywhere
- uniformly set Int.neg flag at the end of computations
- minor cosmetic cleanups
- ran all tests

R=rsc
CC=golang-dev
https://golang.org/cl/1091041
2010-05-03 18:48:05 -07:00
Russ Cox
32df678894 gc: bug264
Fixes #692.

R=ken2
CC=golang-dev
https://golang.org/cl/1092041
2010-05-03 17:51:48 -07:00
Russ Cox
7d7ebd2fe1 runtime, strconv: tiny cleanups
R=r
CC=golang-dev
https://golang.org/cl/1081042
2010-05-03 17:47:40 -07:00
Russ Cox
b5f54db359 gc: bug267
R=ken2
CC=golang-dev
https://golang.org/cl/1067042
2010-05-03 15:29:59 -07:00
Russ Cox
371b77ad20 gc: error for nested functions, one semicolon problem
R=ken2
CC=golang-dev
https://golang.org/cl/1046042
2010-05-03 15:02:32 -07:00
Russ Cox
9995dec9da big: fix memory corruption in nat.shr
R=gri
CC=golang-dev
https://golang.org/cl/1084041
2010-05-03 14:28:45 -07:00
Russ Cox
23c0aa3916 runtime/arm: fix build
Import _mulv from Inferno again, change R9 to R2.
Not sure what the other differences were for, but
they weren't working.

TBR=kaib
CC=golang-dev
https://golang.org/cl/1079041
2010-05-03 13:24:39 -07:00
Evan Shaw
4d1b1574af big: Add bitwise methods for Int
R=gri
CC=golang-dev
https://golang.org/cl/987041
2010-05-03 11:20:52 -07:00
Russ Cox
e6d0a6c9c1 nacl: another attempt at fixing build
TBR=r
CC=golang-dev
https://golang.org/cl/1077041
2010-05-03 11:12:54 -07:00
Russ Cox
23bf408d41 syscall: fix arm build (fix bugs in generator, to add O_LARGEFILE)
R=r
CC=golang-dev
https://golang.org/cl/1021043
2010-05-03 11:11:01 -07:00
Ian Lance Taylor
b3901dc1d8 Add _cgo_export.[ch] targets so that make knows how they are
built.  Note that they are only built if a //export comment
appears, so other targets should only use them if there is
such a comment.

Fixes #723.

R=rsc
CC=golang-dev
https://golang.org/cl/1073041
2010-05-03 11:07:22 -07:00
Rob Pike
e1d20d0a51 bytes: Change IndexAny to look for UTF-8 encoded characters.
Also improve the implementations of Equals and Compare.

R=rsc
CC=golang-dev
https://golang.org/cl/969047
2010-05-03 10:59:00 -07:00
Giles Lean
3c32300c4d runtime: update godefs usage comment for GOARCH=386 GOOS={darwin,freebsd}
When trying to regenerate src/pkg/runtime/darwin/386/defs.h
on a 64 bit capable Snow Leopard (OS X 10.6.3) system I
needed to add -f -m32 to godefs, as this OS and hardware
combination defaults to 64 bit compilation.

For safety, make the same change to the 32 bit FreeBSD
instructions in .../freebsd/defs.c.  (Tested OK and no
problems introduced.)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1052042
2010-05-03 01:26:39 -07:00
Russ Cox
1964417e41 fix nacl build
TBR=r
CC=golang-dev
https://golang.org/cl/1063042
2010-05-03 00:04:48 -07:00
Charles L. Dorian
37089cce67 math: fix typo in Cbrt description
R=rsc
CC=golang-dev
https://golang.org/cl/979043
2010-05-02 23:33:08 -07:00
Robert Griesemer
26078c395a big: cleanup and removal of redundant functionality
R=rsc
CC=golang-dev
https://golang.org/cl/1048041
2010-05-01 15:11:27 -07:00
Russ Cox
6361f52fc4 gc: be pickier about slice, chan, array, and map sizes
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1032044
2010-05-01 13:15:42 -07:00
Russ Cox
cf0e224380 vector: use correct capacity in call to make
R=gri, r, bflm
CC=golang-dev
https://golang.org/cl/1032043
2010-05-01 13:00:01 -07:00
Robert Griesemer
58e77990ba big: use fast shift routines
- fixed a couple of bugs in the process
  (shift right was incorrect for negative numbers)
- added more tests and made some tests more robust
- changed pidigits back to using shifts to multiply
  by 2 instead of add

  This improves pidigit -s -n 10000 by approx. 5%:

  user 0m6.496s (old)
  user 0m6.156s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/963044
2010-04-30 21:25:48 -07:00
Robert Griesemer
161b44c76a big/arith: assembly routines for 386 long shifts (2nd round)
R=rsc
CC=golang-dev
https://golang.org/cl/986044
2010-04-30 14:41:04 -07:00
Russ Cox
c66b49845c 8g: bug272
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1043042
2010-04-30 14:04:34 -07:00
Russ Cox
253fd30e66 gc: bug271
Fixes #662.

R=ken2
CC=golang-dev
https://golang.org/cl/978043
2010-04-30 13:27:08 -07:00
Russ Cox
560283c880 gc: bug270
Fixes #746.

R=ken2
CC=golang-dev
https://golang.org/cl/1040042
2010-04-30 13:04:16 -07:00
Russ Cox
74a23646bc 8l: fix absolute path detection on Windows
Fixes #755.

R=ken2
CC=golang-dev
https://golang.org/cl/965047
2010-04-30 12:48:03 -07:00
Alex Brainman
b94ae26073 syscall: handle EOF on pipe - special case on Windows
R=rsc
CC=golang-dev
https://golang.org/cl/962046
2010-04-30 12:46:46 -07:00
Robert Griesemer
ac1d46a22a fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1044041
2010-04-30 12:01:15 -07:00
Robert Griesemer
407dbb42d4 big: improved computation of "karatsuba length" for faster multiplies
This results in an improvement of > 35% for the existing Mul benchmark
using the same karatsuba threshold, and an improvement of > 50% with
a slightly higher threshold (32 instead of 30):

big.BenchmarkMul           500	   6731846 ns/op (old alg.)
big.BenchmarkMul	   500	   4351122 ns/op (new alg.)
big.BenchmarkMul           500	   3133782 ns/op (new alg., new theshold)

Also:
- tweaked calibrate.go, use same benchmark as for Mul benchmark

R=rsc
CC=golang-dev
https://golang.org/cl/1037041
2010-04-30 11:54:27 -07:00
Robert Griesemer
f78b09e673 big: assembly routines for 386 long shifts
R=rsc
CC=golang-dev
https://golang.org/cl/974043
2010-04-30 11:53:37 -07:00
Robert Griesemer
2b0a30c4b5 big: implemented core shift routines in arith.go and
provide assembly versions (for x86-64 for now)

(Not yet used - waiting for previous CL to clear)

R=rsc
CC=golang-dev
https://golang.org/cl/1040041
2010-04-30 09:29:11 -07:00
Nigel Tao
05cf357dd9 Add EWOULDBLOCK to sycall_nacl.go.
R=rsc
CC=go-dev, golang-dev
https://golang.org/cl/1006045
2010-04-30 18:45:04 +10:00
Alex Brainman
f81d471940 rename GOOS=mingw to GOOS=windows
R=rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/1015043
2010-04-29 23:45:14 -07:00
Russ Cox
7906e31167 syscall: force O_LARGEFILE in Linux open system call
Fixes #717.

R=adg, PeterGo
CC=golang-dev
https://golang.org/cl/1032041
2010-04-29 23:34:06 -07:00
Joe Poirier
4aaddf8a35 syscall: mingw Sleep
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/961047
2010-04-29 23:08:22 -07:00
Russ Cox
77817e08d5 gc: never include ( ) on singleton func return type
Fixes #749.

R=ken2
CC=golang-dev
https://golang.org/cl/963043
2010-04-29 16:07:14 -07:00
Russ Cox
10eb76b04e gc: bug268
Fixes #745.

R=ken2
CC=golang-dev
https://golang.org/cl/1008045
2010-04-29 15:52:27 -07:00
Christopher Wedgwood
b5da6ea4dd net: use short variable declaration
R=rsc
CC=golang-dev
https://golang.org/cl/1019043
2010-04-29 11:02:10 -07:00
Christopher Wedgwood
be9f6344a7 net: parser should handle EOF without newline properly.
Fixes #686.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/979044
2010-04-29 11:01:21 -07:00
Russ Cox
718da3339a darwin: bsdthread_create can fail; print good error
Fixes #549.

R=adg
CC=golang-dev
https://golang.org/cl/1019042
2010-04-28 19:36:42 -07:00
Russ Cox
7c77e450cc net: do not require newline at end of resolv.conf
Fixes #686.

R=adg
CC=golang-dev
https://golang.org/cl/961046
2010-04-28 19:36:04 -07:00
Russ Cox
0485ba72c3 xml: allow text segments to end at EOF
Fixes #674.

R=adg
CC=golang-dev
https://golang.org/cl/1018042
2010-04-28 19:29:20 -07:00
Christopher Wedgwood
1331f8b3cb fmt: %T print <nil> for nil
R=r
CC=golang-dev, rsc
https://golang.org/cl/1014043
2010-04-28 13:07:19 -07:00
Ian Lance Taylor
96179629ef Remove destination of symlink test in case it got left behind
earlier.

R=rsc
CC=golang-dev
https://golang.org/cl/972045
2010-04-28 11:08:07 -07:00
Russ Cox
000ab98df6 5l, 6l, 8l, runtime: make -s binaries work
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary

Fixes #261.

R=iant, r
CC=golang-dev
https://golang.org/cl/994044
2010-04-27 22:40:26 -07:00
Robert Griesemer
b2183701c0 big: implemented Karatsuba multiplication
Plus:
- calibration "test" - include in tests with gotest -calibrate
- basic Mul benchmark
- extra multiplication tests
- various cleanups

This change improves multiplication speed of numbers >= 30 words
in length (current threshold; found empirically with calibrate):

The multiplication benchmark (multiplication of a variety of long numbers)
improves by ~35%, individual multiplies can be significantly faster.

gotest -benchmarks=Mul
big.BenchmarkMul	     500	   6829290 ns/op (w/ Karatsuba)
big.BenchmarkMul	     100	  10600760 ns/op

There's no impact on pidigits for -n=10000 or -n=20000
because the operands are are too small.

R=rsc
CC=golang-dev
https://golang.org/cl/1004042
2010-04-27 19:16:08 -07:00
Russ Cox
dc606a20ce net: drop non-RHEL-4.6 ports from test
Fixes #610.

R=adg
CC=golang-dev
https://golang.org/cl/1006044
2010-04-27 19:04:22 -07:00
Russ Cox
01fc062496 iterable: expose iterFunc as iterable.Func
Fixes #483.

R=dsymonds, dsymonds1
CC=golang-dev
https://golang.org/cl/965044
2010-04-27 18:48:29 -07:00
Russ Cox
9c8cee712d net: fix bug in internetSocket introduced by error cleanup.
Fixes #750.

R=adg
CC=golang-dev
https://golang.org/cl/988043
2010-04-27 18:48:11 -07:00
Russ Cox
69a2e1dc52 gc: better windows detection
R=ken2
CC=golang-dev
https://golang.org/cl/944043
2010-04-27 17:19:15 -07:00
Andrew Gerrand
8553b9c68f template: remove reference to json-template
Rather than confuse people by linking to a spec we
don't fully support, let them just use the package docs.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1016041
2010-04-28 10:14:58 +10:00
Robert Griesemer
e42ebea96c fix build
R=r
CC=golang-dev
https://golang.org/cl/989044
2010-04-27 14:05:53 -07:00
Russ Cox
3bcef5ac30 gc: fix islocalname on windows
Fixes #732.

R=ken2
CC=golang-dev
https://golang.org/cl/956050
2010-04-27 13:52:43 -07:00
Russ Cox
646301a766 rpc/jsonrpc: support for jsonrpc wire encoding
R=r
CC=golang-dev
https://golang.org/cl/989042
2010-04-27 13:51:58 -07:00
Russ Cox
dc644b8f43 json: delete obsolete code
R=r
CC=golang-dev
https://golang.org/cl/943047
2010-04-27 13:51:38 -07:00
Russ Cox
dcff89057b rpc: abstract client and server encodings
R=r
CC=golang-dev, rog
https://golang.org/cl/811046
2010-04-27 13:51:25 -07:00
Robert Griesemer
72f9b2ebee gofmt: fine-tune stripping of parentheses
(composite literals in control clauses only need
       parentheses if the literals start with a type name)

R=rsc
CC=golang-dev
https://golang.org/cl/962045
2010-04-27 13:27:48 -07:00
Robert Griesemer
48ccf8247e go/parser: don't require parens around composite literals inside a composite literal
within an if, for, or switch control clause

R=rsc
CC=golang-dev
https://golang.org/cl/943046
2010-04-27 11:57:17 -07:00
Robert Griesemer
2bfc2d7772 gofmt: don't strip mandatory ()'s around composite literals in control clauses
Fixes #748.

R=rsc
CC=golang-dev
https://golang.org/cl/946043
2010-04-27 10:59:33 -07:00
Russ Cox
0e8384af65 json: streaming
R=r, cw
CC=golang-dev
https://golang.org/cl/952041
2010-04-27 10:46:37 -07:00
Christopher Wedgwood
23c064452c godoc: use int64 for timestamps
This fixes a crash seen when viewing a directory list.

Fixes #747.

R=gri
CC=golang-dev, rsc
https://golang.org/cl/1010042
2010-04-27 10:45:33 -07:00
Russ Cox
bec40ba516 json: preserve field name case by default
This matches the old JSON package behavior.
All lowercase names are not as standard as I believed,
and it seems less surprising to need to write

	type T struct { Field string "field" }

to get lower case (behavior after this CL) than it does to need
to write

	type T struct { Field string "Field" }

to preserve the case (behavior before this CL).

Also test and  fix unmarshal into non-nil interface
value or pointer.

Fixes #744.

R=r
CC=golang-dev
https://golang.org/cl/1013041
2010-04-27 10:24:00 -07:00
Russ Cox
cc62bed075 pipe: implementation #3; this time for sure!
Added goroutine; got simpler.

Fixes deadlock when doing Read+Close
or Write+Close on same end.

R=r, cw
CC=golang-dev
https://golang.org/cl/994043
2010-04-27 10:17:17 -07:00
Micah Stetson
6c124cb879 time: remove incorrect time.ISO8601 and add time.RFC3339
Fixes #734.

R=rsc, r
CC=golang-dev
https://golang.org/cl/975042
2010-04-27 00:05:24 -07:00
Alex Brainman
a83c5f5cad syscall: fix mingw build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/988042
2010-04-26 23:47:53 -07:00
Alex Brainman
fb6b39186b os, syscall: more mingw
R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/878046
2010-04-26 23:17:14 -07:00
Giles Lean
461314b6e7 os: create sys_bsd.go
R=rsc
CC=golang-dev
https://golang.org/cl/897042
2010-04-26 23:01:31 -07:00
Evan Shaw
bf1c881afe os: Fix build for MinGW
R=rsc
CC=golang-dev
https://golang.org/cl/1014041
2010-04-26 22:50:47 -07:00
Charles L. Dorian
22f84c5b2a math: more special cases for signed zero
R=rsc
CC=golang-dev
https://golang.org/cl/937042
2010-04-26 22:44:39 -07:00
Russ Cox
d6e4e18c8c gc: more specific error for statements at top level
R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/1006041
2010-04-26 22:35:27 -07:00
Russ Cox
2a591bdf8a godoc: add codewalk support
R=adg, gri
CC=golang-dev, r
https://golang.org/cl/1008042
2010-04-26 22:35:12 -07:00
Russ Cox
72d9322032 crypto/tls: simpler implementation of record layer
Depends on CL 957045, 980043, 1004043.
Fixes #715.

R=agl1, agl
CC=golang-dev
https://golang.org/cl/943043
2010-04-26 22:19:04 -07:00
Russ Cox
47a0533411 net: introduce net.Error interface
Adds two more methods, Timeout and Temporary.
Implemented by os.Errno too.  The intent is to make
the checks for os.EAGAIN a little less clunky.
It should also let us clean up a bug that Mike Solomon
pointed out: if a network server gets an "out of file descriptors"
error from Accept, the listener should not stop.
It will be able to check this because that error would
have Temporary() == true.

Also clean up some underscore names.

Fixes #442.

R=r
CC=golang-dev, msolo
https://golang.org/cl/957045
2010-04-26 22:15:25 -07:00
Russ Cox
1d18e89125 net: add Pipe
R=r
CC=golang-dev
https://golang.org/cl/1004043
2010-04-26 10:36:05 -07:00
Russ Cox
78551a9b43 bytes: add Next method to Buffer, simplify Read.
R=r
CC=golang-dev
https://golang.org/cl/980043
2010-04-26 10:02:01 -07:00
Russ Cox
9f69ab39f0 xml: fix innerxml handling of & escapes
R=r
CC=golang-dev
https://golang.org/cl/1009041
2010-04-26 10:01:33 -07:00
Russ Cox
13bb28a40a template: fix handling of pointer inside interface
R=r
CC=golang-dev
https://golang.org/cl/982043
2010-04-26 10:01:13 -07:00
Russ Cox
6f33f34bbc regexp: allow escaping of any punctuation
More in line with other regexp packages
and egrep; accommodates overzealous escapers.

R=r
CC=golang-dev
https://golang.org/cl/1008041
2010-04-26 10:00:18 -07:00
Russ Cox
43409ed2c6 libmach: disassemble MOVLQZX correctly
R=ken2
CC=golang-dev
https://golang.org/cl/1007041
2010-04-26 01:09:19 -07:00
Russ Cox
c6138efbcb runtime: closures, defer bug fix for Native Client
Enable package tests for Native Client build.

R=r
CC=golang-dev
https://golang.org/cl/957042
2010-04-22 17:52:22 -07:00
Rob Pike
6e80a01ab7 os/stat_freebsd.go: maybe fix build for freebsd
R=rsc
CC=golang-dev
https://golang.org/cl/970042
2010-04-22 17:04:28 -07:00
Evan Shaw
841a32dd5e big: Create type nat
Changed most of the functions in nat.go to methods on nat.

R=gri
CC=golang-dev
https://golang.org/cl/976041
2010-04-22 16:57:29 -07:00
Rob Pike
5cd8c83037 FileInfo: regularize the types of some fields.
Uid, Gid become int.
File size info becomes int64.
Times become int64.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/968042
2010-04-22 14:01:33 -07:00
Evan Shaw
f0ecf34f29 vector: Don't always regenerate {int,string}vector.go
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/917042
2010-04-23 00:43:59 +10:00
Evan Shaw
455e799f6d big: Add some tests
R=rsc, gri
CC=golang-dev
https://golang.org/cl/967041
2010-04-21 17:12:36 -07:00
Russ Cox
dba9d62bc2 json: Marshal, Unmarshal using new scanner
R=r
CC=golang-dev
https://golang.org/cl/953041
2010-04-21 16:40:53 -07:00
Russ Cox
214a55b06a runtime: switch state back to Grunning after recovery
Fixes #733.

R=r
CC=golang-dev
https://golang.org/cl/958041
2010-04-21 16:27:41 -07:00
Russ Cox
e7b6fe3989 xml: new "innerxml" tag to collect inner XML
R=r
CC=golang-dev
https://golang.org/cl/971041
2010-04-21 16:27:31 -07:00
Russ Cox
57d9de3ac8 utf16: add DecodeRune, EncodeRune
R=r
CC=golang-dev
https://golang.org/cl/970041
2010-04-21 16:27:18 -07:00
Russ Cox
1b70b61411 big: fix build - start with zero in scanN
R=gri, eds
CC=golang-dev
https://golang.org/cl/947042
2010-04-20 22:51:48 -07:00
Kyle Consalus
d7b4851586 strings: add ReadRune to Reader
R=rsc
CC=golang-dev
https://golang.org/cl/940041
2010-04-20 22:18:26 -07:00
Evan Shaw
e4136fe91c big: eliminate redundant array lookups
This gives about a 6% performance improvement to pidigits.
Thanks to Russ for the suggestion.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/957041
2010-04-20 21:41:58 -07:00
Evan Shaw
4f445d2744 big: reduce the number of allocations
There was a bug in makeN that caused lots of unnecessary
allocations.  Fixing this exposed a few bugs in other
functions which worked when makeN allocated a new slice, but
failed when it simply resized an existing slice.  The result
is a pretty big performance improvement.  When running
pidigits, here were the numbers I got on amd64:

Before this change:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.02s 2.11r
        gc pidigits     12.68u 0.04s 12.72r
        gc_B pidigits   12.71u 0.03s 12.75r

After:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.00s 2.10r
        gc pidigits     6.82u 0.00s 6.85r
        gc_B pidigits   6.55u 0.01s 6.59r

R=rsc, gri
CC=golang-dev
https://golang.org/cl/953042
2010-04-20 21:24:07 -07:00
Russ Cox
1c0c252880 6l, 8l: include ELF header in PT_LOAD mapping for text segment
Due to page boundary rounding, the header would have
been loaded as part of the text segment already, but this
change placates the "paxctl" tool on so-called hardened
Linux distributions (as if normal distributions weren't already
hard enough to use).

R=r
CC=golang-dev
https://golang.org/cl/954041
2010-04-20 20:39:55 -07:00
Evan Shaw
76cbbc8a95 big: Add Lsh and Value; convert pidigits to use big
This yields a pretty significant performance boost to pidigits and there are still some improvements to be made. Here are my numbers:

amd64 w/ bignum:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.10u 0.00s 2.10r
        gc pidigits     22.92u 0.02s 22.97r
        gc_B pidigits   22.62u 0.00s 22.65r

amd64 w/ big:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.02s 2.11r
        gc pidigits     12.68u 0.04s 12.72r
        gc_B pidigits   12.71u 0.03s 12.75r

386 w/ bignum:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.00s 2.09r
        gc pidigits     44.30u 0.01s 44.35r
        gc_B pidigits   44.29u 0.03s 44.35r

386 w/ big:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.10u 0.00s 2.10r
        gc pidigits     22.70u 0.06s 22.79r
        gc_B pidigits   22.80u 0.09s 22.91r

R=rsc, gri
CC=golang-dev
https://golang.org/cl/881050
2010-04-20 20:39:36 -07:00
Russ Cox
4ba177ae36 gc: print x[y:] correctly
R=ken2
CC=golang-dev
https://golang.org/cl/955041
2010-04-20 17:39:31 -07:00
Russ Cox
20c50cf0f8 runtime: rename cgo2c, *.cgo to goc2c, *.goc
to avoid confusion with real cgo

R=r
CC=golang-dev
https://golang.org/cl/904046
2010-04-20 17:03:25 -07:00
Russ Cox
7295b61cdb reflect: implement Set(nil), SetValue(nil) for PtrValue and MapValue
R=r
CC=golang-dev
https://golang.org/cl/823048
2010-04-20 17:02:08 -07:00
Evan Shaw
73374c93a6 big: Get rid of function pointers and init function
R=rsc, gri
CC=golang-dev
https://golang.org/cl/929041
2010-04-19 19:07:22 -07:00
Kyle Consalus
ad2c5a4984 Added strings.FieldsFunc, a generalization of strings.Fields in style of the strings.Trim*Func functions.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/824051
2010-04-19 16:36:50 -07:00
Russ Cox
d97bbabbaa gc: cmplx typecheck bug fix
Fixes #729.

R=ken2
CC=golang-dev
https://golang.org/cl/875048
2010-04-19 09:21:51 -07:00
Andrew Gerrand
3ffbd57b94 syscall: match linux Setsid function signature to darwin
SETSID does return an errno - any reason why it has been done this
way in zsyscall_linux_* ? Otherwise it should be the same as darwin.

From SETSID(2) on my Linux box:

ERRORS
       On error, -1 is returned, and errno is set.

Fixes #730

R=rsc
CC=golang-dev
https://golang.org/cl/878047
2010-04-19 13:12:11 +10:00
Raif S. Naffah
57e764171c reflect: add FieldByNameFunc
xml: add support for XML marshalling embedded structs.

R=rsc
CC=golang-dev
https://golang.org/cl/837042
2010-04-18 15:22:36 -07:00
Michael Hoisie
13f81feb31 net: fix bugs in packStructValue
packStructValue was cutting off last byte of uint32
in _Dns_msg.Unpack, use packRR for rr types

R=rsc
CC=golang-dev
https://golang.org/cl/844048
2010-04-18 14:46:24 -07:00
Russ Cox
3cfa2c3ddf json: scanner, Compact, Indent, and tests
This is the first of probably four separate CLs
for the new implementation of the json package.

The scanner is the core of the new implementation.
The other CLs would be the new decoder,
the new encoder, and support for JSON streams.

R=r
CC=golang-dev
https://golang.org/cl/802051
2010-04-18 14:45:08 -07:00
Rob Pike
3f7da4f861 rpc: Add Close() method to rpc.Client to allow graceful connection teardown.
Fixes #675.

R=rsc, msolo
CC=golang-dev
https://golang.org/cl/882049
2010-04-16 16:17:47 -07:00
Evan Shaw
9ca10b0a5c exp/eval: Always read float literals as base 10
We were letting bignum decide, which caused problems with float literals with a leading 0.

R=gri
CC=golang-dev
https://golang.org/cl/816047
2010-04-15 19:53:35 -07:00
Evan Shaw
ff922fe15a go/ast: Update comment to mention imaginary literals
R=gri
CC=golang-dev
https://golang.org/cl/846050
2010-04-15 18:06:22 -07:00
Evan Shaw
39a2e82ee6 exp/eval: Implement x[lo:]
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/908044
2010-04-15 18:04:24 -07:00
Russ Cox
a318f9d3a4 flag: eliminate unnecessary structs
R=r
CC=golang-dev
https://golang.org/cl/872045
2010-04-15 15:25:46 -07:00
Andrei Vieru
fffac8072e "godoc -src pkg_name" excludes duplicates entries
$ godoc xml | grep Copy\(\)
func (c CharData) Copy() CharData
func (c Comment) Copy() Comment
func (d Directive) Copy() Directive
func (p ProcInst) Copy() ProcInst
func (e StartElement) Copy() StartElement
--------------------------------------------
$ godoc -src xml | grep Copy\(\)
func (c CharData) Copy() CharData
--------------------------------------------
$ godoc -src xml Copy
func (c CharData) Copy() CharData { return CharData(makeCopy(c)) }
--------------------------------------------
The command "godoc -src pkg_name" should output the interface of the named package, but it excludes all duplicate entries. Also the command "godoc -src pkg_name method_name" will output the source code only for one method even if there are more of them with the same name in the same package. This patch set fixes this issue.

R=gri
CC=golang-dev
https://golang.org/cl/883051
2010-04-15 09:50:37 -07:00
Kai Backman
df3a544085 synchronize ARM runner environment variable with run-arm
R=rsc
CC=golang-dev
https://golang.org/cl/912041
2010-04-15 12:47:49 +03:00
Kai Backman
26e846429d support for printing floats:
fmt.Printf("float32 %f\n", float32(1234.56789))
fmt.Printf("float64 %f\n", float64(1234.56789))
->
float32 1234.567871
float64 1234.567890

this is a snapshot. extended instruction support, corner cases
and fixes coming in subseuent cls.

R=rsc
CC=dpx, golang-dev
https://golang.org/cl/876045
2010-04-15 12:43:49 +03:00
Robert Griesemer
0fd00c8bb7 scanner: implement Peek() to look at the next char w/o advancing
R=rsc
CC=golang-dev
https://golang.org/cl/840045
2010-04-14 21:33:34 -07:00
Russ Cox
1baf35e41f bytes: shuffle implementation, making WriteByte 50% faster
R=r
CC=golang-dev
https://golang.org/cl/920041
2010-04-14 01:52:56 -07:00
Russ Cox
c3e54f0988 runtime: better trace for fault due to nil pointer call
R=r
CC=golang-dev
https://golang.org/cl/854048
2010-04-13 22:31:47 -07:00
Alex Brainman
035265975f os, syscall: mingw bug fixes
R=rsc
CC=golang-dev
https://golang.org/cl/815044
2010-04-13 22:30:41 -07:00
Alex Brainman
b07e4d9511 os: mingw version of Readdir() and Stat() implemented
R=rsc
CC=golang-dev
https://golang.org/cl/851045
2010-04-13 16:30:11 -07:00
Evan Shaw
30f981d980 8l: add DOS stub to PE binaries
R=rsc
CC=golang-dev
https://golang.org/cl/915041
2010-04-13 16:13:53 -07:00