]> Cypherpunks repositories - gostls13.git/log
gostls13.git
16 years ago1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:35:38 +0000 (15:35 -0800)]
1) Change default gofmt default settings for
   parsing and printing to new syntax.

   Use -oldparser to parse the old syntax,
   use -oldprinter to print the old syntax.

2) Change default gofmt formatting settings
   to use tabs for indentation only and to use
   spaces for alignment. This will make the code
   alignment insensitive to an editor's tabwidth.

   Use -spaces=false to use tabs for alignment.

3) Manually changed src/exp/parser/parser_test.go
   so that it doesn't try to parse the parser's
   source files using the old syntax (they have
   new syntax now).

4) gofmt -w src misc test/bench

3rd set of files.

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

16 years ago 1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:33:31 +0000 (15:33 -0800)]
           1) Change default gofmt default settings for
                  parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

       1st set of files.

R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047

16 years agoupdate tutorial.
Rob Pike [Tue, 15 Dec 2009 23:29:53 +0000 (10:29 +1100)]
update tutorial.

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

16 years ago 1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:27:16 +0000 (15:27 -0800)]
           1) Change default gofmt default settings for
                  parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

       2nd set of files.

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

16 years agogc: double-check usage of ...
Russ Cox [Tue, 15 Dec 2009 22:26:50 +0000 (14:26 -0800)]
gc: double-check usage of ...

Fixes #423.

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

16 years agogc: var x, ok = m[y]
Russ Cox [Tue, 15 Dec 2009 22:26:33 +0000 (14:26 -0800)]
gc: var x, ok = m[y]

Fixes #384.

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

16 years agoTweak test to work with both 6g and gccgo.
Ian Lance Taylor [Tue, 15 Dec 2009 21:57:24 +0000 (13:57 -0800)]
Tweak test to work with both 6g and gccgo.

Pull the struct into a single line, since 6g reports the error
on the last line of the struct definition and gccgo reports it
on the first line.

6g:
bug215.go:12: invalid recursive type A

gccgo:
bug215.go:12:6: error: invalid recursive type ‘A’

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

16 years agocodereview: add golang-dev@googlegroups.com
Russ Cox [Tue, 15 Dec 2009 21:36:05 +0000 (13:36 -0800)]
codereview: add golang-dev@googlegroups.com
    automatically in "hg mail".
also, avoid "empty list means all modified files in client" bug

R=gri, cw
CC=golang-dev
https://golang.org/cl/174072

16 years agofix TODO: insert semicolons before any sequence of comments
Robert Griesemer [Tue, 15 Dec 2009 16:41:50 +0000 (08:41 -0800)]
fix TODO: insert semicolons before any sequence of comments
that introduce the newline (important for correct placement
of comments with gofmt when parsing new syntax)

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

16 years agoxml: handle unexpected EOF while parsing and fix a bug in name
Arvindh Rajesh Tamilmani [Tue, 15 Dec 2009 03:28:36 +0000 (19:28 -0800)]
xml: handle unexpected EOF while parsing and fix a bug in name

mustgetc reports unexpected EOF as SyntaxError.  using
mustgetc seems to be a better approach than letting the
caller handle unexpected EOF every time.

name: the second if statement should explicitly return
ok==false.

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

16 years agoruntime: in exitsyscall, avoid confusing garbage collector
Russ Cox [Tue, 15 Dec 2009 03:06:20 +0000 (19:06 -0800)]
runtime: in exitsyscall, avoid confusing garbage collector

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

16 years agoimproved formatting of import declarations and
Robert Griesemer [Tue, 15 Dec 2009 01:35:12 +0000 (17:35 -0800)]
improved formatting of import declarations and
multi-line expressions with comments

Fixes #414.

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

16 years agocrypto/sha256: new package
Andy Davis [Mon, 14 Dec 2009 23:09:49 +0000 (15:09 -0800)]
crypto/sha256: new package

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

16 years agosimpler fix for the negative rune problem, spotted seconds after submitting the previ...
Rob Pike [Mon, 14 Dec 2009 22:31:24 +0000 (09:31 +1100)]
simpler fix for the negative rune problem, spotted seconds after submitting the previous fix.

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

16 years agogenerate replacement rune when asked to encode a negative rune value.
Rob Pike [Mon, 14 Dec 2009 22:19:54 +0000 (09:19 +1100)]
generate replacement rune when asked to encode a negative rune value.
Fixes #425.

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

16 years agoarchive/tar: bug fixes.
Christopher Wedgwood [Mon, 14 Dec 2009 19:35:02 +0000 (11:35 -0800)]
archive/tar: bug fixes.
1. If all data is exhausted using Read then a following Next will
   fail as if it saw EOF.  (Test case added.)
2. Seeking isn't always possible (i.e. sockets and pipes).  Fallback
   to read.  (Test case added.)
3. Fix to readHeader (cleaner fix pointed out by rsc).
   (TestReader modified.)
4. When Read has consumed all the data, don't try to read 0 bytes from reader.
   In cases where tr.nb is zero we attempt to read zero bytes and thus
   never see an EOF (this is most easily seen when the 'tar source' is
   something like bytes.Buffer{} as opposed to os.File).
5. If write is used to the point of ErrWriteTooLong, allow additional file entries.
6. Make close work as expected.  That is any further Write or
   WriteHeader attempts will result in ErrWriteAfterClose.
Fixes #419.

R=rsc, dsymonds1
https://golang.org/cl/162062

16 years agodon't show semicolons anymore with godoc
Robert Griesemer [Mon, 14 Dec 2009 17:14:00 +0000 (09:14 -0800)]
don't show semicolons anymore with godoc

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

16 years agoA+C: two more names
Russ Cox [Mon, 14 Dec 2009 02:39:04 +0000 (18:39 -0800)]
A+C: two more names
Andy Davis (individual CLA)
Arvindh Rajesh Tamilmani (individual CLA)

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

16 years agofix naked < as reported by pwil3058@gmail.com
Rob Pike [Mon, 14 Dec 2009 02:30:11 +0000 (13:30 +1100)]
fix naked < as reported by pwil3058@gmail.com

R=rsc
CC=pwil3058
https://golang.org/cl/174087

16 years agoWhen the buffer is empty, reset b.off to the beginning of the buffer
Rob Pike [Mon, 14 Dec 2009 02:13:01 +0000 (13:13 +1100)]
When the buffer is empty, reset b.off to the beginning of the buffer
to avoid growing unnecessarily.

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

16 years agosyscall: fix error return bug for 64-bit return on 32-bit platform
Christopher Wedgwood [Sun, 13 Dec 2009 21:05:49 +0000 (13:05 -0800)]
syscall: fix error return bug for 64-bit return on 32-bit platform

R=dho, rsc
CC=r
https://golang.org/cl/176058

16 years ago8l: add support for PE output.
Hector Chu [Sun, 13 Dec 2009 20:39:20 +0000 (12:39 -0800)]
8l: add support for PE output.

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

16 years agoclean.bash: stop if $GOROOT is not set
Christopher Wedgwood [Sun, 13 Dec 2009 20:27:19 +0000 (12:27 -0800)]
clean.bash: stop if $GOROOT is not set

Doing rm -rf /pkg/.. blindly isn't nice.  It could have
unintended consequences.

Secondly set bash to abort on (unexpected) errors.

R=dho, rsc
CC=golang-dev
https://golang.org/cl/176056

16 years agoPorted godefs to Windows.
Hector Chu [Sun, 13 Dec 2009 20:21:44 +0000 (12:21 -0800)]
Ported godefs to Windows.

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

16 years agogc: fix comment
Russ Cox [Sun, 13 Dec 2009 20:11:56 +0000 (12:11 -0800)]
gc: fix comment

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

16 years agoUpdate goyacc to new syntax, still with semicolons.
Rob Pike [Sun, 13 Dec 2009 19:34:51 +0000 (06:34 +1100)]
Update goyacc to new syntax, still with semicolons.
Update units.y too.
Fixes #417.

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

16 years agomore on the optimizer
Ken Thompson [Sat, 12 Dec 2009 22:36:52 +0000 (14:36 -0800)]
more on the optimizer
trying to get alizses
to optimize

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

16 years agofix bug for large counts: used a one-byte buffer.
Rob Pike [Sat, 12 Dec 2009 20:27:43 +0000 (07:27 +1100)]
fix bug for large counts: used a one-byte buffer.

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

16 years agoVarious cleanups:
Robert Griesemer [Sat, 12 Dec 2009 00:42:14 +0000 (16:42 -0800)]
Various cleanups:
- no need to replace comments for stand-alone blocks
- always print string concatenations with interspersed "+"
  (remove option)
- minor cleanups

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

16 years agogc: semicolons
Russ Cox [Fri, 11 Dec 2009 23:59:41 +0000 (15:59 -0800)]
gc: semicolons

Fixes #89.
Fixes #92.
Fixes #118.
Fixes #182.
Fixes #328.
Fixes #340.

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/172049

16 years agobug in 6g optimizer
Ken Thompson [Fri, 11 Dec 2009 23:55:09 +0000 (15:55 -0800)]
bug in 6g optimizer
8g still needs fixing

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

16 years agoparser changed to reflect new semicolon rules
Robert Griesemer [Fri, 11 Dec 2009 23:31:24 +0000 (15:31 -0800)]
parser changed to reflect new semicolon rules

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

16 years agofix printer test for new syntax
Robert Griesemer [Fri, 11 Dec 2009 23:31:06 +0000 (15:31 -0800)]
fix printer test for new syntax

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

16 years agoRemove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
Devon H. O'Dell [Fri, 11 Dec 2009 23:14:09 +0000 (15:14 -0800)]
Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src

This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.

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

16 years agomisc/bash: completion file for bash
Russ Cox [Fri, 11 Dec 2009 21:54:00 +0000 (13:54 -0800)]
misc/bash: completion file for bash
suggested by Alex Ray <ajray@ncsu.edu>

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

16 years agoencoding/binary: Add support for slices of arrays of fixed-size values.
Maxim Ushakov [Fri, 11 Dec 2009 21:04:03 +0000 (13:04 -0800)]
encoding/binary: Add support for slices of arrays of fixed-size values.

R=rsc
CC=krasin
https://golang.org/cl/167050

16 years agoAdd a Makefile in place of all.bash. Update docs to reflect
Devon H. O'Dell [Fri, 11 Dec 2009 20:48:55 +0000 (12:48 -0800)]
Add a Makefile in place of all.bash. Update docs to reflect
this change.

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

16 years agosyslog: new package
Yves Junqueira [Fri, 11 Dec 2009 20:41:51 +0000 (12:41 -0800)]
syslog: new package

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

16 years agomkbuiltin: generate builtin.c directly
Yongjian Xu [Fri, 11 Dec 2009 20:41:33 +0000 (12:41 -0800)]
mkbuiltin: generate builtin.c directly

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

16 years agoA+C:
Russ Cox [Fri, 11 Dec 2009 20:41:04 +0000 (12:41 -0800)]
A+C:
Andrey Mirtchovski (individual CLA),
Maxim Ushakov (Google),
Yongjian Xu (individual CLA)

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

16 years agobytes, strings: allow -1 in Map to mean "drop this character".
Kei Son [Fri, 11 Dec 2009 18:37:48 +0000 (10:37 -0800)]
bytes, strings: allow -1 in Map to mean "drop this character".

xml: drop invalid characters in attribute names
    when constructing struct field names.

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

16 years ago- make make test working again
Robert Griesemer [Fri, 11 Dec 2009 03:07:10 +0000 (19:07 -0800)]
- make make test working again
- some factoring for easier experimentation

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

16 years agoNew flags for gofmt:
Robert Griesemer [Fri, 11 Dec 2009 03:03:28 +0000 (19:03 -0800)]
New flags for gofmt:
- oldparser            parse old syntax (required semicolons)
- oldprinter           print old syntax (required semicolons)

By default, these flags are enabled for now.
Setting -oldparser=false has no effect until go/parser is changed
to accept the new syntax.

Enabled exp/parser in Makefile; update dependent exp/eval.

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

16 years agorename exp/parser package to oldParser
Robert Griesemer [Fri, 11 Dec 2009 02:27:48 +0000 (18:27 -0800)]
rename exp/parser package to oldParser
to allow simultaneous import with the
current go/parser

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

16 years agoSpec modified to reflect new semicolon rules.
Robert Griesemer [Fri, 11 Dec 2009 00:43:01 +0000 (16:43 -0800)]
Spec modified to reflect new semicolon rules.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/166066

16 years agoimplement NoSemis and NoStringConcat mode for go/printer
Robert Griesemer [Thu, 10 Dec 2009 23:45:57 +0000 (15:45 -0800)]
implement NoSemis and NoStringConcat mode for go/printer

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

16 years agoimplemented InsertSemis mode for go/scanner
Robert Griesemer [Thu, 10 Dec 2009 23:31:02 +0000 (15:31 -0800)]
implemented InsertSemis mode for go/scanner

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

16 years ago- unmodified copy of existing go/parser, not yet hooked up
Robert Griesemer [Thu, 10 Dec 2009 22:26:25 +0000 (14:26 -0800)]
- unmodified copy of existing go/parser, not yet hooked up

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

16 years agotrailing comma's are not accepted with current syntax
Robert Griesemer [Thu, 10 Dec 2009 21:14:44 +0000 (13:14 -0800)]
trailing comma's are not accepted with current syntax

R=rsc, ken2
https://golang.org/cl/174047

16 years agotest/fixedbug: drop obsolete bug125, bug166
Russ Cox [Thu, 10 Dec 2009 20:54:30 +0000 (12:54 -0800)]
test/fixedbug: drop obsolete bug125, bug166

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

16 years agomake test/ken safe for optional semis
Robert Griesemer [Thu, 10 Dec 2009 20:53:23 +0000 (12:53 -0800)]
make test/ken safe for optional semis

R=rsc, ken2, ken3
https://golang.org/cl/174042

16 years agofix calling convention and make memmove restore the g and m
Kai Backman [Thu, 10 Dec 2009 19:42:01 +0000 (11:42 -0800)]
fix calling convention and make memmove restore the g and m
registers.

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

16 years agoadded SHUT_RD, SHOT_WR and xSHUT_RDWR to fix net compilation error
Kai Backman [Thu, 10 Dec 2009 19:40:11 +0000 (11:40 -0800)]
added SHUT_RD, SHOT_WR and xSHUT_RDWR to fix net compilation error

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

16 years agomake test/fixedbugs save for optional semis
Robert Griesemer [Thu, 10 Dec 2009 19:25:54 +0000 (11:25 -0800)]
make test/fixedbugs save for optional semis

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

16 years agomissed a couple of files in test
Robert Griesemer [Thu, 10 Dec 2009 05:39:20 +0000 (21:39 -0800)]
missed a couple of files in test

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

16 years agomaking some more non-gofmt'ed files save for new semicolon rule
Robert Griesemer [Thu, 10 Dec 2009 03:27:08 +0000 (19:27 -0800)]
making some more non-gofmt'ed files save for new semicolon rule

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

16 years ago- gofmt these files
Robert Griesemer [Thu, 10 Dec 2009 00:55:03 +0000 (16:55 -0800)]
- gofmt these files
- remove use of implicit string concatenation
- these appear to be the only files correctly compiling under test
  that used implicit string concatenation

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

16 years agominor manual format corrections
Robert Griesemer [Thu, 10 Dec 2009 00:54:24 +0000 (16:54 -0800)]
minor manual format corrections

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

16 years agoremove uses of string concatenation from src and misc directory
Robert Griesemer [Thu, 10 Dec 2009 00:54:07 +0000 (16:54 -0800)]
remove uses of string concatenation from src and misc directory

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

16 years agohgtags: add release tag, again.
Russ Cox [Wed, 9 Dec 2009 22:55:31 +0000 (14:55 -0800)]
hgtags: add release tag, again.

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

16 years agohgtags: looks like they have to be full hashes
Russ Cox [Wed, 9 Dec 2009 22:54:58 +0000 (14:54 -0800)]
hgtags: looks like they have to be full hashes

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

16 years agohgtags: add release pointing at 2009-12-09's checkin.
Russ Cox [Wed, 9 Dec 2009 22:48:56 +0000 (14:48 -0800)]
hgtags: add release pointing at 2009-12-09's checkin.

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

16 years agohgtags: tag release.2009-12-07 (where gccgo is)
Russ Cox [Wed, 9 Dec 2009 22:47:29 +0000 (14:47 -0800)]
hgtags: tag release.2009-12-07 (where gccgo is)
   and release.2009-12-09 (where we are)

shorten tags because it is too hard to look up the
full size hash and overkill anyway.

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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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