]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
14 years agodoc/contribute: try to make it clearer that you send a review with hg mail, not hg... weekly.2009-12-09
Russ Cox [Wed, 9 Dec 2009 22:39:41 +0000 (14:39 -0800)]
doc/contribute: try to make it clearer that you send a review with hg mail, not hg submit.

R=r
https://golang.org/cl/171046

14 years agoadded benchmarks to rand_test.go;
Roger Peppe [Wed, 9 Dec 2009 22:23:43 +0000 (14:23 -0800)]
added benchmarks to rand_test.go;
removed superfluous field name in lockedSource.

R=r, rsc
https://golang.org/cl/170043

14 years agosyscalls can return negative i/o counts. fix bugs in ReadAt and WriteAt not to include
Rob Pike [Wed, 9 Dec 2009 22:18:32 +0000 (14:18 -0800)]
syscalls can return negative i/o counts. fix bugs in ReadAt and WriteAt not to include
negative counts in return values.

R=rsc
CC=golang-dev
https://golang.org/cl/170044

14 years agodoc: split contribute.html into code.html and contribute.html
Russ Cox [Wed, 9 Dec 2009 22:05:12 +0000 (14:05 -0800)]
doc: split contribute.html into code.html and contribute.html

R=r
https://golang.org/cl/170042

14 years agoMake the operations on the global rng thread safe.
Roger Peppe [Wed, 9 Dec 2009 20:55:19 +0000 (12:55 -0800)]
Make the operations on the global rng thread safe.

R=r, rsc
CC=golang-dev
https://golang.org/cl/168041

14 years agoContinuation of issue 221 fix. When 8g or 6g or 5g are called with a
Charles L. Dorian [Wed, 9 Dec 2009 19:56:45 +0000 (11:56 -0800)]
Continuation of issue 221 fix. When 8g or 6g or 5g are called with a
UTF-8 string, Yconv() converts it into an octal sequence. If the
string converted to more than 30 bytes, the str buffer would
overflow. For example, 4 Greek runes became 32 bytes, 3 Hiragana
runes became 36 bytes, and 2 Gothic runes became 32 bytes. In
8l, 6l and 5l the function is Sconv(). For some reason, only 5l uses
the constant STRINGSZ (defined as 200) for the buffer size.

R=rsc
https://golang.org/cl/168045

14 years agojson package: Fixed handling of nil values
Ross Light [Wed, 9 Dec 2009 18:36:03 +0000 (10:36 -0800)]
json package: Fixed handling of nil values

Fixes #400.

R=golang-dev, rsc
https://golang.org/cl/167058

14 years agoAdded my name to the AUTHORS and CONTRIBUTORS list
Ross Light [Wed, 9 Dec 2009 18:35:48 +0000 (10:35 -0800)]
Added my name to the AUTHORS and CONTRIBUTORS list

R=rsc
https://golang.org/cl/165101

14 years agoAdded XTEA block cipher package to src/pkg/crypto
Adrian O'Grady [Wed, 9 Dec 2009 08:06:20 +0000 (00:06 -0800)]
Added XTEA block cipher package to src/pkg/crypto

This is an adaption of the code from http://en.wikipedia.org/wiki/XTEA. The package also implements the block.Cipher
interface so that it can be used with the various block modes.

R=rsc
https://golang.org/cl/157152

14 years agoruntime: start new darwin/amd64 threads on correct stack,
Russ Cox [Wed, 9 Dec 2009 07:34:45 +0000 (23:34 -0800)]
runtime: start new darwin/amd64 threads on correct stack,
    then enable stack check.

R=r
https://golang.org/cl/165100

14 years agoA+C: two more names
Russ Cox [Wed, 9 Dec 2009 02:20:06 +0000 (18:20 -0800)]
A+C: two more names
   Kei Son has completed the CLA.
   Yves Junqueira is a Google employee.

R=r
https://golang.org/cl/167057

14 years agobufio: use copy - significant speedup for writers
Russ Cox [Wed, 9 Dec 2009 02:19:48 +0000 (18:19 -0800)]
bufio: use copy - significant speedup for writers

R=r
https://golang.org/cl/167047

14 years agoFix stack on FreeBSD / add stack check across the board
Devon H. O'Dell [Wed, 9 Dec 2009 02:19:30 +0000 (18:19 -0800)]
Fix stack on FreeBSD / add stack check across the board

FreeBSD was passing stk as the new thread's stack base, while
stk is the top of the stack in go. The added check should cause
a trap if this ever comes up in any new ports, or regresses
in current ones.

R=rsc
CC=golang-dev
https://golang.org/cl/167055

14 years agoWhen SA_SIGINFO is set, we should use __sa_sigaction on FreeBSD
Devon H. O'Dell [Wed, 9 Dec 2009 02:18:04 +0000 (18:18 -0800)]
When SA_SIGINFO is set, we should use __sa_sigaction on FreeBSD

R=rsc
CC=golang-dev
https://golang.org/cl/165097

14 years ago6l, 8l: make string buffer big enough for 8 chars (and then some) weekly.2009-12-07
Russ Cox [Tue, 8 Dec 2009 06:01:59 +0000 (22:01 -0800)]
6l, 8l: make string buffer big enough for 8 chars (and then some)

Fixes #221.

R=ken2
https://golang.org/cl/165086

14 years agotest/bench: faster fasta (mostly due to bufio fix)
Russ Cox [Tue, 8 Dec 2009 03:39:09 +0000 (19:39 -0800)]
test/bench: faster fasta (mostly due to bufio fix)

R=r
https://golang.org/cl/165083

14 years agoruntime: don't touch pages of memory unnecessarily.
Russ Cox [Mon, 7 Dec 2009 23:52:14 +0000 (15:52 -0800)]
runtime: don't touch pages of memory unnecessarily.
cuts working size for hello world from 6 MB to 1.2 MB.
still some work to be done, but diminishing returns.

R=r
https://golang.org/cl/165080

14 years agoruntime: introduce unsafe.New and unsafe.NewArray
Russ Cox [Mon, 7 Dec 2009 23:51:58 +0000 (15:51 -0800)]
runtime: introduce unsafe.New and unsafe.NewArray
    to provide functionality previously hacked in to
    reflect and gob.

R=r
https://golang.org/cl/165076

14 years agouse a bootstrap array to avoid allocation for short vectors
Robert Griesemer [Mon, 7 Dec 2009 20:46:20 +0000 (12:46 -0800)]
use a bootstrap array to avoid allocation for short vectors

R=r
https://golang.org/cl/165078

14 years agoRemove copyBytes completely in favor of copy.
Christopher Wedgwood [Mon, 7 Dec 2009 19:31:56 +0000 (11:31 -0800)]
Remove copyBytes completely in favor of copy.

R=r, rsc
https://golang.org/cl/165068

14 years agopick off special one-byte case in copy. worth 2x in benchmarks (38ns->16ns).
Rob Pike [Mon, 7 Dec 2009 19:28:02 +0000 (11:28 -0800)]
pick off special one-byte case in copy. worth 2x in benchmarks (38ns->16ns).
the one-item case could be generalized easily with no cost. worth considering.

R=rsc
CC=golang-dev, cw
https://golang.org/cl/167044

14 years agothe AST walker currently provides no way to find out how the
Roger Peppe [Mon, 7 Dec 2009 18:33:45 +0000 (10:33 -0800)]
the AST walker currently provides no way to find out how the
nodes in the tree are nested with respect to one another.
a simple change to the Visitor interface makes it possible
to do this (for example to maintain a current node-depth, or a
knowledge of the name of the current function).

Visit(nil) is called at the end of a node's children;
this make possible the channel-based interface below,
amongst other possibilities.

It is still just as simple to get the original behaviour - just
return the same Visitor from Visit.

Here are a couple of possible Visitor types.

// closure-based
type FVisitor func(n interface{}) FVisitor
func (f FVisitor) Visit(n interface{}) Visitor {
return f(n);
}

// channel-based
type CVisitor chan Visit;
type Visit struct {
node interface{};
reply chan CVisitor;
};
func (v CVisitor) Visit(n interface{}) Visitor
{
if n == nil {
close(v);
} else {
reply := make(chan CVisitor);
v <- Visit{n, reply};
r := <-reply;
if r == nil {
return nil;
}
return r;
}
return nil;
}

R=gri
CC=rsc
https://golang.org/cl/166047

14 years agochanges necessary to get the new chameneosredux onto shootout.alioth.debian.org .
Roger Peppe [Mon, 7 Dec 2009 18:06:51 +0000 (10:06 -0800)]
changes necessary to get the new chameneosredux onto shootout.alioth.debian.org .
it's now there: http://shootout.alioth.debian.org/u32q/benchmark.php?test=chameneosredux&lang=all&box=1!

R=r, rsc
CC=golang-dev
https://golang.org/cl/167043

14 years agosave a few ns by inlining (which mostly simplifies things anyway).
Rob Pike [Sun, 6 Dec 2009 23:01:07 +0000 (15:01 -0800)]
save a few ns by inlining (which mostly simplifies things anyway).
a couple of cleanups.
don't keep big buffers in the free list.

R=rsc
CC=golang-dev
https://golang.org/cl/166078

14 years agounexport Fmt. it's not needed outside this package any more
Rob Pike [Sun, 6 Dec 2009 20:58:16 +0000 (12:58 -0800)]
unexport Fmt. it's not needed outside this package any more
cleans up godoc's output for package fmt substantially.

R=rsc
CC=golang-dev
https://golang.org/cl/165070

14 years agoMake printing faster by avoiding mallocs and some other advances.
Rob Pike [Sun, 6 Dec 2009 20:03:52 +0000 (12:03 -0800)]
Make printing faster by avoiding mallocs and some other advances.
Roughly 33% faster for simple cases, probably more for complex ones.

Before:

mallocs per Sprintf(""): 4
mallocs per Sprintf("xxx"): 6
mallocs per Sprintf("%x"): 10
mallocs per Sprintf("%x %x"): 12

Now:

mallocs per Sprintf(""): 2
mallocs per Sprintf("xxx"): 3
mallocs per Sprintf("%x"): 5
mallocs per Sprintf("%x %x"): 7

Speed improves because of avoiding mallocs and also by sharing a bytes.Buffer
between print.go and format.go rather than copying the data back after each
printed item.

Before:

fmt_test.BenchmarkSprintfEmpty 1000000       1346 ns/op
fmt_test.BenchmarkSprintfString 500000       3461 ns/op
fmt_test.BenchmarkSprintfInt 500000       3671 ns/op

Now:

fmt_test.BenchmarkSprintfEmpty  2000000        995 ns/op
fmt_test.BenchmarkSprintfString  1000000       2745 ns/op
fmt_test.BenchmarkSprintfInt  1000000       2391 ns/op
fmt_test.BenchmarkSprintfIntInt   500000       3751 ns/op

I believe there is more to get but this is a good milestone.

R=rsc
CC=golang-dev, hong
https://golang.org/cl/166076

14 years agoruntime: disable pointer scan optimization
Russ Cox [Sun, 6 Dec 2009 16:18:58 +0000 (08:18 -0800)]
runtime: disable pointer scan optimization
  * broken by reflect, gob

TBR=r
https://golang.org/cl/166077

14 years agoFix syscall.Statfs and syscall.Fstatfs for 386 GNU/Linux.
Ian Lance Taylor [Sat, 5 Dec 2009 05:58:32 +0000 (21:58 -0800)]
Fix syscall.Statfs and syscall.Fstatfs for 386 GNU/Linux.

For 386 we use the [f]statfs64 system call, which takes three
parameters: the filename, the size of the statfs64 structure,
and a pointer to the structure itself.

R=rsc
https://golang.org/cl/166073

14 years agotest/bench: use range in reverse-complement
Russ Cox [Sat, 5 Dec 2009 05:44:29 +0000 (21:44 -0800)]
test/bench: use range in reverse-complement

1.9s gcc reverse-complement.c

reverse-complement.go
4.5s / 3.5s original, with/without bounds checks
3.5s / 3.3s bounds check reduction
3.3s / 2.8s smarter garbage collector
2.6s / 2.3s assembler bytes.IndexByte
2.5s / 2.1s even smarter garbage collector
2.3s / 2.1s fix optimizer unnecessary spill bug
2.0s / 1.9s change loop to range (this CL)

R=r
https://golang.org/cl/166072

14 years agogc/runtime: pass type structure to makeslice.
Russ Cox [Sat, 5 Dec 2009 05:44:05 +0000 (21:44 -0800)]
gc/runtime: pass type structure to makeslice.
  * inform garbage collector about memory with no pointers in it

1.9s gcc reverse-complement.c

reverse-complement.go
4.5s / 3.5s original, with/without bounds checks
3.5s / 3.3s bounds check reduction
3.3s / 2.8s smarter garbage collector
2.6s / 2.3s assembler bytes.IndexByte
2.5s / 2.1s even smarter garbage collector (this CL)

R=r
https://golang.org/cl/165064

14 years agogc: walk pointer in range on slice/array
Russ Cox [Sat, 5 Dec 2009 04:40:21 +0000 (20:40 -0800)]
gc: walk pointer in range on slice/array

R=ken2
https://golang.org/cl/166071

14 years ago6g/8g optimizer fix: throw functions now in runtime
Russ Cox [Sat, 5 Dec 2009 04:37:32 +0000 (20:37 -0800)]
6g/8g optimizer fix: throw functions now in runtime

R=ken2
https://golang.org/cl/166070

14 years agotest/bench: dead code in reverse-complement
Russ Cox [Sat, 5 Dec 2009 03:25:25 +0000 (19:25 -0800)]
test/bench: dead code in reverse-complement

R=r
https://golang.org/cl/165065

14 years agogotest: stop if the // gotest commands fail
Russ Cox [Sat, 5 Dec 2009 02:34:59 +0000 (18:34 -0800)]
gotest: stop if the // gotest commands fail

R=r
https://golang.org/cl/166067

14 years agonet: more fiddling with the udp test.
Russ Cox [Sat, 5 Dec 2009 02:34:45 +0000 (18:34 -0800)]
net: more fiddling with the udp test.
  i don't know why the timeout needs
  to be so big.

R=r
https://golang.org/cl/165063

14 years agolibmach: fix disassembly of MOVLQSX
Russ Cox [Sat, 5 Dec 2009 02:34:35 +0000 (18:34 -0800)]
libmach: fix disassembly of MOVLQSX

R=r
https://golang.org/cl/166068

14 years agogotest: ignore *_test.pb.go
Russ Cox [Sat, 5 Dec 2009 01:08:54 +0000 (17:08 -0800)]
gotest: ignore *_test.pb.go

R=r
https://golang.org/cl/166064

14 years agoAdd syscall.Rename for NaCl. Fixes NaCl build.
Ian Lance Taylor [Fri, 4 Dec 2009 21:49:58 +0000 (13:49 -0800)]
Add syscall.Rename for NaCl.  Fixes NaCl build.

R=rsc
https://golang.org/cl/165062

14 years agoruntime: shift the index for the sort by one.
Adam Langley [Fri, 4 Dec 2009 21:31:18 +0000 (13:31 -0800)]
runtime: shift the index for the sort by one.

Makes the code look cleaner, even if it's a little harder to figure
out from the sort invariants.

R=rsc
CC=golang-dev
https://golang.org/cl/165061

14 years agoAdd os.Rename.
Ian Lance Taylor [Fri, 4 Dec 2009 19:46:56 +0000 (11:46 -0800)]
Add os.Rename.

R=rsc
https://golang.org/cl/166058

14 years agoRemove global chanlock.
Adam Langley [Fri, 4 Dec 2009 18:57:01 +0000 (10:57 -0800)]
Remove global chanlock.

On a microbenchmark that ping-pongs on lots of channels, this makes
the multithreaded case about 20% faster and the uniprocessor case
about 1% slower. (Due to cache effects, I expect.)

R=rsc, agl
CC=golang-dev
https://golang.org/cl/166043

14 years agobytes: asm for bytes.IndexByte
Russ Cox [Fri, 4 Dec 2009 18:23:43 +0000 (10:23 -0800)]
bytes: asm for bytes.IndexByte

PERFORMANCE DIFFERENCE

SUMMARY

                                                   amd64           386
2.2 GHz AMD Opteron 8214 HE (Linux)             3.0x faster    8.2x faster
3.60 GHz Intel Xeon (Linux)                     2.2x faster    6.2x faster
2.53 GHz Intel Core2 Duo E7200 (Linux)          1.5x faster    4.4x faster
2.66 Ghz Intel Xeon 5150 (Mac Pro, OS X)        1.5x SLOWER    3.0x faster
2.33 GHz Intel Xeon E5435 (Linux)               1.5x SLOWER    3.0x faster
2.33 GHz Intel Core2 T7600 (MacBook Pro, OS X)  1.4x SLOWER    3.0x faster
1.83 GHz Intel Core2 T5600 (Mac Mini, OS X)        none*       3.0x faster

* but yesterday I consistently saw 1.4x SLOWER.

DETAILS

2.2 GHz AMD Opteron 8214 HE (Linux)

amd64 (3x faster)

IndexByte4K            500000           3733 ns/op     1097.24 MB/s
IndexByte4M               500        4328042 ns/op      969.10 MB/s
IndexByte64M               50       67866160 ns/op      988.84 MB/s

IndexBytePortable4K    200000          11161 ns/op      366.99 MB/s
IndexBytePortable4M       100       11795880 ns/op      355.57 MB/s
IndexBytePortable64M       10      188675000 ns/op      355.68 MB/s

386 (8.2x faster)

IndexByte4K            500000           3734 ns/op     1096.95 MB/s
IndexByte4M               500        4209954 ns/op      996.28 MB/s
IndexByte64M               50       68031980 ns/op      986.43 MB/s

IndexBytePortable4K     50000          30670 ns/op      133.55 MB/s
IndexBytePortable4M        50       31868220 ns/op      131.61 MB/s
IndexBytePortable64M        2      508851500 ns/op      131.88 MB/s

3.60 GHz Intel Xeon (Linux)

amd64 (2.2x faster)

IndexByte4K            500000           4612 ns/op      888.12 MB/s
IndexByte4M               500        4835250 ns/op      867.44 MB/s
IndexByte64M               20       77388450 ns/op      867.17 MB/s

IndexBytePortable4K    200000          10306 ns/op      397.44 MB/s
IndexBytePortable4M       100       11201460 ns/op      374.44 MB/s
IndexBytePortable64M       10      179456800 ns/op      373.96 MB/s

386 (6.3x faster)

IndexByte4K            500000           4631 ns/op      884.47 MB/s
IndexByte4M               500        4846388 ns/op      865.45 MB/s
IndexByte64M               20       78691200 ns/op      852.81 MB/s

IndexBytePortable4K    100000          28989 ns/op      141.29 MB/s
IndexBytePortable4M        50       31183180 ns/op      134.51 MB/s
IndexBytePortable64M        5      498347200 ns/op      134.66 MB/s

2.53 GHz Intel Core2 Duo E7200  (Linux)

amd64 (1.5x faster)

IndexByte4K            500000           6502 ns/op      629.96 MB/s
IndexByte4M               500        6692208 ns/op      626.74 MB/s
IndexByte64M               10      107410400 ns/op      624.79 MB/s

IndexBytePortable4K    200000           9721 ns/op      421.36 MB/s
IndexBytePortable4M       100       10013680 ns/op      418.86 MB/s
IndexBytePortable64M       10      160460800 ns/op      418.23 MB/s

386 (4.4x faster)

IndexByte4K            500000           6505 ns/op      629.67 MB/s
IndexByte4M               500        6694078 ns/op      626.57 MB/s
IndexByte64M               10      107397600 ns/op      624.86 MB/s

IndexBytePortable4K    100000          28835 ns/op      142.05 MB/s
IndexBytePortable4M        50       29562680 ns/op      141.88 MB/s
IndexBytePortable64M        5      473221400 ns/op      141.81 MB/s

2.66 Ghz Intel Xeon 5150  (Mac Pro, OS X)

amd64 (1.5x SLOWER)

IndexByte4K            200000           9290 ns/op      440.90 MB/s
IndexByte4M               200        9568925 ns/op      438.33 MB/s
IndexByte64M               10      154473600 ns/op      434.44 MB/s

IndexBytePortable4K    500000           6202 ns/op      660.43 MB/s
IndexBytePortable4M       500        6583614 ns/op      637.08 MB/s
IndexBytePortable64M       20      107166250 ns/op      626.21 MB/s

386 (3x faster)

IndexByte4K            200000           9301 ns/op      440.38 MB/s
IndexByte4M               200        9568025 ns/op      438.37 MB/s
IndexByte64M               10      154391000 ns/op      434.67 MB/s

IndexBytePortable4K    100000          27526 ns/op      148.80 MB/s
IndexBytePortable4M       100       28302490 ns/op      148.20 MB/s
IndexBytePortable64M        5      454170200 ns/op      147.76 MB/s

2.33 GHz Intel Xeon E5435  (Linux)

amd64 (1.5x SLOWER)

IndexByte4K            200000          10601 ns/op      386.38 MB/s
IndexByte4M               100       10827240 ns/op      387.38 MB/s
IndexByte64M               10      173175500 ns/op      387.52 MB/s

IndexBytePortable4K    500000           7082 ns/op      578.37 MB/s
IndexBytePortable4M       500        7391792 ns/op      567.43 MB/s
IndexBytePortable64M       20      122618550 ns/op      547.30 MB/s

386 (3x faster)

IndexByte4K            200000          11074 ns/op      369.88 MB/s
IndexByte4M               100       10902620 ns/op      384.71 MB/s
IndexByte64M               10      181292800 ns/op      370.17 MB/s

IndexBytePortable4K     50000          31725 ns/op      129.11 MB/s
IndexBytePortable4M        50       32564880 ns/op      128.80 MB/s
IndexBytePortable64M        2      545926000 ns/op      122.93 MB/s

2.33 GHz Intel Core2 T7600 (MacBook Pro, OS X)

amd64 (1.4x SLOWER)

IndexByte4K            200000          11120 ns/op      368.35 MB/s
IndexByte4M               100       11531950 ns/op      363.71 MB/s
IndexByte64M               10      184819000 ns/op      363.11 MB/s

IndexBytePortable4K    500000           7419 ns/op      552.10 MB/s
IndexBytePortable4M       200        8018710 ns/op      523.06 MB/s
IndexBytePortable64M       10      127614900 ns/op      525.87 MB/s

386 (3x faster)

IndexByte4K            200000          11114 ns/op      368.54 MB/s
IndexByte4M               100       11443530 ns/op      366.52 MB/s
IndexByte64M               10      185212000 ns/op      362.34 MB/s

IndexBytePortable4K     50000          32891 ns/op      124.53 MB/s
IndexBytePortable4M        50       33930580 ns/op      123.61 MB/s
IndexBytePortable64M        2      545400500 ns/op      123.05 MB/s

1.83 GHz Intel Core2 T5600  (Mac Mini, OS X)

amd64 (no difference)

IndexByte4K            200000          13497 ns/op      303.47 MB/s
IndexByte4M               100       13890650 ns/op      301.95 MB/s
IndexByte64M                5      222358000 ns/op      301.81 MB/s

IndexBytePortable4K    200000          13584 ns/op      301.53 MB/s
IndexBytePortable4M       100       13913280 ns/op      301.46 MB/s
IndexBytePortable64M       10      222572600 ns/op      301.51 MB/s

386 (3x faster)

IndexByte4K            200000          13565 ns/op      301.95 MB/s
IndexByte4M               100       13882640 ns/op      302.13 MB/s
IndexByte64M                5      221411600 ns/op      303.10 MB/s

IndexBytePortable4K     50000          39978 ns/op      102.46 MB/s
IndexBytePortable4M        50       41038160 ns/op      102.20 MB/s
IndexBytePortable64M        2      656362500 ns/op      102.24 MB/s

R=r
CC=golang-dev
https://golang.org/cl/166055

14 years agospec: document that built-ins cannot be used as func values
Russ Cox [Fri, 4 Dec 2009 18:23:12 +0000 (10:23 -0800)]
spec: document that built-ins cannot be used as func values

R=gri
CC=golang-dev
https://golang.org/cl/164088

14 years agomake Native Client support build again,
Russ Cox [Fri, 4 Dec 2009 18:11:32 +0000 (10:11 -0800)]
make Native Client support build again,
add README explaining how to try the
web demos.

Fixes #339.

R=r
CC=barry.d.silverman, bss, vadim
https://golang.org/cl/165057

14 years agotesting: compute MB/s in benchmarks
Russ Cox [Fri, 4 Dec 2009 17:56:31 +0000 (09:56 -0800)]
testing: compute MB/s in benchmarks

R=r
https://golang.org/cl/166060

14 years agoavoid an allocation inside bytes.Buffer by providing a static array.
Rob Pike [Fri, 4 Dec 2009 08:26:08 +0000 (00:26 -0800)]
avoid an allocation inside bytes.Buffer by providing a static array.

R=rsc
https://golang.org/cl/165058

14 years ago8l: fix print line number format, buffer overflow
Russ Cox [Fri, 4 Dec 2009 07:29:48 +0000 (23:29 -0800)]
8l: fix print line number format, buffer overflow

R=ken2
https://golang.org/cl/165059

14 years agonet: turn off empty packet test by default
Russ Cox [Fri, 4 Dec 2009 06:19:55 +0000 (22:19 -0800)]
net: turn off empty packet test by default

Fixes #374.

R=r
https://golang.org/cl/166053

14 years agogc: check for assignment to private fields during initialization
Russ Cox [Fri, 4 Dec 2009 06:09:58 +0000 (22:09 -0800)]
gc: check for assignment to private fields during initialization

R=ken2
https://golang.org/cl/165055

14 years ago6g code gen bug
Ken Thompson [Fri, 4 Dec 2009 04:28:24 +0000 (20:28 -0800)]
6g code gen bug

R=rsc
https://golang.org/cl/166052

14 years agoAdd Count, Cycle, ZipWith, GroupBy, Repeat, RepeatTimes, Unique to exp/iterable.
Michael Elkins [Fri, 4 Dec 2009 04:03:07 +0000 (20:03 -0800)]
Add Count, Cycle, ZipWith, GroupBy, Repeat, RepeatTimes, Unique to exp/iterable.

Modify iterFunc to take chan<- instead of just chan.

R=rsc, dsymonds1
CC=golang-dev, r
https://golang.org/cl/160064

14 years agocrypto/rsa: fix shadowing error.
Adam Langley [Fri, 4 Dec 2009 03:33:23 +0000 (19:33 -0800)]
crypto/rsa: fix shadowing error.

Fixes bug 375.

R=rsc
https://golang.org/cl/165045

14 years agoruntime: fix Caller crash on 386.
Russ Cox [Fri, 4 Dec 2009 01:24:14 +0000 (17:24 -0800)]
runtime: fix Caller crash on 386.

Fixes #176.

R=r
https://golang.org/cl/166044

14 years agofaq: add question about translation
Russ Cox [Fri, 4 Dec 2009 01:23:33 +0000 (17:23 -0800)]
faq: add question about translation

R=jini, r
https://golang.org/cl/163092

14 years agocodereview: do not gofmt deleted files
Russ Cox [Fri, 4 Dec 2009 01:23:11 +0000 (17:23 -0800)]
codereview: do not gofmt deleted files

R=r
https://golang.org/cl/164083

14 years agoMake.conf: fix if $HOME has spaces
Russ Cox [Fri, 4 Dec 2009 01:22:43 +0000 (17:22 -0800)]
Make.conf: fix if $HOME has spaces

R=r
https://golang.org/cl/164086

14 years agoruntime: malloc fixes
Russ Cox [Fri, 4 Dec 2009 01:22:23 +0000 (17:22 -0800)]
runtime: malloc fixes
  * throw away dead code
  * add mlookup counter
  * add malloc counter
  * set up for blocks with no pointers

Fixes #367.

R=r
https://golang.org/cl/165050

14 years agoThe String() method requires global state that makes it not work outside of this...
Rob Pike [Fri, 4 Dec 2009 01:14:32 +0000 (17:14 -0800)]
The String() method requires global state that makes it not work outside of this package,
so make it a local method (_String()).

R=rsc
CC=golang-dev
https://golang.org/cl/165049

14 years agoerror propagation in gob/encoder.
Rob Pike [Fri, 4 Dec 2009 01:12:57 +0000 (17:12 -0800)]
error propagation in gob/encoder.

R=rsc
CC=golang-dev
https://golang.org/cl/165048

14 years agoAdd ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without buffer alloca...
Rob Pike [Thu, 3 Dec 2009 20:56:16 +0000 (12:56 -0800)]
Add ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without buffer allocation.
Use them in Copy and Copyn.
Speed up ReadFile by using ReadFrom and avoiding Copy altogether (a minor win).

R=rsc, gri
CC=golang-dev
https://golang.org/cl/166041

14 years agogc: Allow allow data types up to 1GB
Christopher Wedgwood [Thu, 3 Dec 2009 20:46:34 +0000 (12:46 -0800)]
gc: Allow allow data types up to 1GB

R=rsc
https://golang.org/cl/164095

14 years ago- include type-associated consts and vars when filtering a PackageDoc
Robert Griesemer [Thu, 3 Dec 2009 19:25:20 +0000 (11:25 -0800)]
- include type-associated consts and vars when filtering a PackageDoc
- fixes a godoc issue (for instance, "godoc os EOF" now shows an entry)

R=r
CC=rsc
https://golang.org/cl/165042

14 years agogc: handle _ = <-c in select.
Russ Cox [Thu, 3 Dec 2009 09:30:19 +0000 (01:30 -0800)]
gc: handle _ = <-c in select.

Fixes #238.

R=ken2
https://golang.org/cl/163098

14 years agogc: recursive type error
Russ Cox [Thu, 3 Dec 2009 09:12:02 +0000 (01:12 -0800)]
gc: recursive type error

Fixes #245.

R=ken2
https://golang.org/cl/164094

14 years agogc: better diagnosis of initialization loops
Russ Cox [Thu, 3 Dec 2009 08:51:03 +0000 (00:51 -0800)]
gc: better diagnosis of initialization loops

Fixes bug 292.

R=ken2
https://golang.org/cl/164093

14 years agogc: minor import grammar bug fixes
Russ Cox [Thu, 3 Dec 2009 08:10:32 +0000 (00:10 -0800)]
gc: minor import grammar bug fixes

Fixes #364.

R=ken2
https://golang.org/cl/164092

14 years agominor improvement to formatting: don't allocate padding strings every time.
Rob Pike [Thu, 3 Dec 2009 08:04:40 +0000 (00:04 -0800)]
minor improvement to formatting: don't allocate padding strings every time.

R=rsc
https://golang.org/cl/164090

14 years agogc: function argument ordering bug
Russ Cox [Thu, 3 Dec 2009 07:54:51 +0000 (23:54 -0800)]
gc: function argument ordering bug

Fixes #370.

R=ken2
https://golang.org/cl/163097

14 years agogc: make 'invalid rune in string' a little less cryptic
Russ Cox [Thu, 3 Dec 2009 07:23:11 +0000 (23:23 -0800)]
gc: make 'invalid rune in string' a little less cryptic

Fixes #371.

R=ken2
https://golang.org/cl/164091

14 years agomove ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
Rob Pike [Thu, 3 Dec 2009 06:02:14 +0000 (22:02 -0800)]
move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
this breaks the dependency of package io on package bytes.

R=rsc
CC=golang-dev
https://golang.org/cl/163085

14 years agoRunes: turn string into []int
Peter Froehlich [Thu, 3 Dec 2009 04:47:38 +0000 (20:47 -0800)]
Runes: turn string into []int
Split: fixed typo in documentation

R=rsc, r, r1
https://golang.org/cl/157170

14 years agoupdated documentation for gofmt
Robert Griesemer [Thu, 3 Dec 2009 03:32:15 +0000 (19:32 -0800)]
updated documentation for gofmt

R=rsc
https://golang.org/cl/164085

14 years ago8g: discard tempalloc/tempfree experiment
Russ Cox [Thu, 3 Dec 2009 02:31:29 +0000 (18:31 -0800)]
8g: discard tempalloc/tempfree experiment
in favor of tempname.
allows optimizer to do more.
unfortunately, optimizer seems to be broken; disable it.

R=ken2
https://golang.org/cl/163091

14 years ago6g etc: groundwork for eliminating redundant bounds checks.
Russ Cox [Thu, 3 Dec 2009 01:30:07 +0000 (17:30 -0800)]
6g etc: groundwork for eliminating redundant bounds checks.
drop check in range over array.
drop check in [256]array indexed by byte.

R=ken2
https://golang.org/cl/163088

14 years agoAdd flag -tabindent to gofmt: forces use of
Robert Griesemer [Thu, 3 Dec 2009 00:57:15 +0000 (16:57 -0800)]
Add flag -tabindent to gofmt: forces use of
tabs for indentation even if -spaces is set.

Changes to gofmt:
- added -tabindent flag
- don't recompute parser and printer mode repeatedly

Changes to go/printer:
- provide new printing mode TabIndent

Changes to tabwriter:
- implement new mode TabIndent to use tabs independent
  of the actual padding character for leading empty columns
- distinguish between minimal cell width and tab width
  (tabwidth is only used if the output contains tabs,
  minwidth and padding are always considered)
- fixed and added more comments
- some additional factoring

By default, -tabindent is disabled and the default gofmt
behavior is unchanged. By setting -spaces and -tabindent,
gofmt will use tabs for indentation but do any other
alignment with spaces. This permits a user to change the
visible indentation by simply changing the editor's tab
width and the code will remain properly aligned without
the need to rerun gofmt.

R=rsc
https://golang.org/cl/163068

14 years agonet: test and fix support for 0-length datagram packets.
Russ Cox [Wed, 2 Dec 2009 23:17:49 +0000 (15:17 -0800)]
net: test and fix support for 0-length datagram packets.

Fixes #274.

R=r
CC=jonathan.r.hudson
https://golang.org/cl/163072

14 years agochange the naming example from Vector to Ring due to loss of vector.New()
Rob Pike [Wed, 2 Dec 2009 21:46:02 +0000 (13:46 -0800)]
change the naming example from Vector to Ring due to loss of vector.New()

R=rsc
CC=golang-dev
https://golang.org/cl/164082

14 years agoAdd copy to the list of predeclared functions.
Ian Lance Taylor [Wed, 2 Dec 2009 21:26:39 +0000 (13:26 -0800)]
Add copy to the list of predeclared functions.

R=gri
https://golang.org/cl/164081

14 years agogofmt: race condition in error reporting and setting exit code
Fazlul Shahriar [Wed, 2 Dec 2009 21:02:42 +0000 (13:02 -0800)]
gofmt: race condition in error reporting and setting exit code

How to reproduce:

$ mkdir /tmp/foo
$ cp /dev/null /tmp/foo/bar.go
$ chmod -r /tmp/foo/bar.go
$ gofmt /tmp/foo
open /tmp/foo/bar.go: permission denied
$ echo $? # should echo 2
0
$

Maybe you need to put a call to time.Sleep at the beginning of report().

R=gri
CC=golang-dev
https://golang.org/cl/164073

14 years agoapply gofmt to json files
Robert Griesemer [Wed, 2 Dec 2009 19:40:54 +0000 (11:40 -0800)]
apply gofmt to json files

R=rsc
https://golang.org/cl/164071

14 years agofix segfault printing errors. add test case and improve messages.
Rob Pike [Wed, 2 Dec 2009 18:41:28 +0000 (10:41 -0800)]
fix segfault printing errors. add test case and improve messages.

Fixes #338.

R=rsc
CC=golang-dev
https://golang.org/cl/163083

14 years agotest that arrays work properly.
Rob Pike [Wed, 2 Dec 2009 18:25:14 +0000 (10:25 -0800)]
test that arrays work properly.
can't mix slices and arrays now; perhaps that should be a TODO

R=rsc
https://golang.org/cl/164079

14 years agocodereview: move reviewers to cc line after submit,
Russ Cox [Wed, 2 Dec 2009 17:10:59 +0000 (09:10 -0800)]
codereview: move reviewers to cc line after submit,
  so that the issue stops showing up on the
  per-reviewer dashboard page.

R=r
https://golang.org/cl/164075

14 years agotime: another bug in SecondsToUTC.
Russ Cox [Wed, 2 Dec 2009 16:27:57 +0000 (08:27 -0800)]
time: another bug in SecondsToUTC.
added random test to look for more.

Fixes #363.

R=r, cw
https://golang.org/cl/163071

14 years agoAdd Shutdown to 32-bit GNU/Linux build.
Ian Lance Taylor [Wed, 2 Dec 2009 16:24:14 +0000 (08:24 -0800)]
Add Shutdown to 32-bit GNU/Linux build.

Submitting as a TBR to fix the build.

R=dho, rsc
https://golang.org/cl/164078

14 years ago lxml.etree is the wrong location for this alt package
Devon H. O'Dell [Wed, 2 Dec 2009 16:18:26 +0000 (08:18 -0800)]
lxml.etree is the wrong location for this alt package

  on my linux machine this is the correct one. lxml.etree
  exists with an ElementTree class, but does not contain
  an .XML method.

R=rsc
https://golang.org/cl/163082

14 years agoxml.etree can also be lxml.etree (e.g. CentOS 5.4 with Python 2.4.3)
Devon H. O'Dell [Wed, 2 Dec 2009 09:16:38 +0000 (01:16 -0800)]
xml.etree can also be lxml.etree (e.g. CentOS 5.4 with Python 2.4.3)

R=rsc
CC=golang-dev
https://golang.org/cl/164053

14 years agotime: fix handling of Jan 1 1601, 1201, 801, ...
Russ Cox [Wed, 2 Dec 2009 07:38:06 +0000 (23:38 -0800)]
time: fix handling of Jan 1 1601, 1201, 801, ...

R=r
CC=hurtonm
https://golang.org/cl/164074

14 years agonet: fix netFD.Close races
Devon H. O'Dell [Wed, 2 Dec 2009 07:28:57 +0000 (23:28 -0800)]
net: fix netFD.Close races

Fixes #271.
Fixes #321.

R=rsc, agl, cw
CC=golang-dev
https://golang.org/cl/163052

14 years agoexplicitly catch attempt to decode into a value - must be a pointer to see the result.
Rob Pike [Wed, 2 Dec 2009 05:47:00 +0000 (21:47 -0800)]
explicitly catch attempt to decode into a value - must be a pointer to see the result.

R=rsc
https://golang.org/cl/163070

14 years agomake io.ReadFile use Stat.Size as a hint for preallocation
Rob Pike [Wed, 2 Dec 2009 05:44:24 +0000 (21:44 -0800)]
make io.ReadFile use Stat.Size as a hint for preallocation

R=rsc
CC=golang-dev
https://golang.org/cl/163069

14 years agoAdd syscall.Shutdown to FreeBSD i386/amd64
Devon H. O'Dell [Wed, 2 Dec 2009 05:43:39 +0000 (21:43 -0800)]
Add syscall.Shutdown to FreeBSD i386/amd64

Necessary for 163052

R=rsc
CC=golang-dev
https://golang.org/cl/164068

14 years ago8g: Match sgen definition to declaration
Evan Shaw [Wed, 2 Dec 2009 05:42:35 +0000 (21:42 -0800)]
8g: Match sgen definition to declaration

R=rsc
CC=golang-dev
https://golang.org/cl/164069

14 years agoFreeBSD needs #!/usr/bin/env bash (fixes broken build on FreeBSD)
Devon H. O'Dell [Wed, 2 Dec 2009 03:30:17 +0000 (19:30 -0800)]
FreeBSD needs #!/usr/bin/env bash (fixes broken build on FreeBSD)

R=gri
https://golang.org/cl/163067

14 years agosyscall: add Shutdown on OS X, add more constants in mkerror.sh
Russ Cox [Wed, 2 Dec 2009 00:53:43 +0000 (16:53 -0800)]
syscall: add Shutdown on OS X, add more constants in mkerror.sh

R=dho
CC=golang-dev
https://golang.org/cl/163061

14 years agoAdd 'copy' as a Go builtin function for Vim syntax highlighter spec.
David Symonds [Wed, 2 Dec 2009 00:45:21 +0000 (16:45 -0800)]
Add 'copy' as a Go builtin function for Vim syntax highlighter spec.

R=rsc
https://golang.org/cl/163049

14 years agoupdate package unicode to Unicode 5.2
Rob Pike [Wed, 2 Dec 2009 00:22:21 +0000 (16:22 -0800)]
update package unicode to Unicode 5.2

R=rsc
CC=golang-dev
https://golang.org/cl/163062

14 years agogob: fix build
Russ Cox [Wed, 2 Dec 2009 00:18:27 +0000 (16:18 -0800)]
gob: fix build

TBR=r
https://golang.org/cl/163064

14 years agoIntegrated feedback by Ken.
Robert Griesemer [Wed, 2 Dec 2009 00:15:53 +0000 (16:15 -0800)]
Integrated feedback by Ken.
Easy stuff in this round, more to come.

R=iant, rsc, r, ken2
https://golang.org/cl/163058

14 years agoExplicitly return values where it's shadowing the parameter.
Christopher Wedgwood [Tue, 1 Dec 2009 23:54:49 +0000 (15:54 -0800)]
Explicitly return values where it's shadowing the parameter.

Bad returns noticed by "Devon H. O'Dell" <devon.odell@gmail.com>.

Resolves Issue 360.

R=rsc, dho, agl, agl1
CC=ukai
https://golang.org/cl/163055