summaryrefslogtreecommitdiff
path: root/src/pkg
AgeCommit message (Collapse)AuthorFilesLines
2009-12-15fix TODO: insert semicolons before any sequence of commentsRobert Griesemer2-45/+72
that introduce the newline (important for correct placement of comments with gofmt when parsing new syntax) R=rsc http://codereview.appspot.com/179055
2009-12-14xml: handle unexpected EOF while parsing and fix a bug in nameArvindh Rajesh Tamilmani2-27/+104
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 http://codereview.appspot.com/174083 Committer: Russ Cox <rsc@golang.org>
2009-12-14runtime: in exitsyscall, avoid confusing garbage collectorRuss Cox1-1/+6
R=r CC=golang-dev http://codereview.appspot.com/178046
2009-12-14improved formatting of import declarations andRobert Griesemer6-7/+110
multi-line expressions with comments Fixes issue 414. R=rsc http://codereview.appspot.com/179047
2009-12-14crypto/sha256: new packageAndy Davis5-0/+333
R=rsc CC=golang-dev http://codereview.appspot.com/176062 Committer: Russ Cox <rsc@golang.org>
2009-12-15simpler fix for the negative rune problem, spotted seconds after submitting ↵Rob Pike1-19/+17
the previous fix. R=rsc http://codereview.appspot.com/178044
2009-12-15generate replacement rune when asked to encode a negative rune value.Rob Pike2-9/+26
Fixes issue 425. R=rsc http://codereview.appspot.com/178043
2009-12-14archive/tar: bug fixes.Christopher Wedgwood3-37/+167
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 issue 419. R=rsc, dsymonds1 http://codereview.appspot.com/162062 Committer: Russ Cox <rsc@golang.org>
2009-12-14When the buffer is empty, reset b.off to the beginning of the bufferRob Pike1-2/+20
to avoid growing unnecessarily. R=rsc CC=golang-dev http://codereview.appspot.com/176071
2009-12-13syscall: fix error return bug for 64-bit return on 32-bit platformChristopher Wedgwood5-29/+35
R=dho, rsc CC=r http://codereview.appspot.com/176058 Committer: Russ Cox <rsc@golang.org>
2009-12-13fix bug for large counts: used a one-byte buffer.Rob Pike1-3/+2
R=rsc CC=golang-dev http://codereview.appspot.com/174082
2009-12-11Various cleanups:Robert Griesemer3-23/+17
- no need to replace comments for stand-alone blocks - always print string concatenations with interspersed "+" (remove option) - minor cleanups R=rsc http://codereview.appspot.com/174076
2009-12-11parser changed to reflect new semicolon rulesRobert Griesemer2-229/+167
R=rsc http://codereview.appspot.com/175046 Committer: Robert Griesemer <gri@golang.org>
2009-12-11fix printer test for new syntaxRobert Griesemer9-105/+277
R=rsc http://codereview.appspot.com/175048
2009-12-11Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/srcDevon H. O'Dell3-11/+14
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 http://codereview.appspot.com/171044 Committer: Russ Cox <rsc@golang.org>
2009-12-11encoding/binary: Add support for slices of arrays of fixed-size values.Maxim Ushakov2-6/+52
R=rsc CC=krasin http://codereview.appspot.com/167050 Committer: Russ Cox <rsc@golang.org>
2009-12-11syslog: new packageYves Junqueira5-3/+258
R=golang-dev, rsc http://codereview.appspot.com/157168 Committer: Russ Cox <rsc@golang.org>
2009-12-11bytes, strings: allow -1 in Map to mean "drop this character".Kei Son6-26/+91
xml: drop invalid characters in attribute names when constructing struct field names. R=rsc CC=r http://codereview.appspot.com/157104 Committer: Russ Cox <rsc@golang.org>
2009-12-10New flags for gofmt:Robert Griesemer2-1/+2
- 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 http://codereview.appspot.com/174051
2009-12-10rename exp/parser package to oldParserRobert Griesemer3-8/+13
to allow simultaneous import with the current go/parser R=rsc http://codereview.appspot.com/174053
2009-12-10implement NoSemis and NoStringConcat mode for go/printerRobert Griesemer2-5/+22
R=rsc http://codereview.appspot.com/174050
2009-12-10implemented InsertSemis mode for go/scannerRobert Griesemer2-20/+236
R=rsc http://codereview.appspot.com/175047
2009-12-10- unmodified copy of existing go/parser, not yet hooked upRobert Griesemer4-0/+2326
R=rsc CC=r http://codereview.appspot.com/175045
2009-12-10fix calling convention and make memmove restore the g and mKai Backman1-2/+10
registers. R=rsc http://codereview.appspot.com/166049
2009-12-10added SHUT_RD, SHOT_WR and xSHUT_RDWR to fix net compilation errorKai Backman1-0/+3
R=rsc http://codereview.appspot.com/165044
2009-12-09minor manual format correctionsRobert Griesemer2-3/+1
R=rsc http://codereview.appspot.com/172042
2009-12-09remove uses of string concatenation from src and misc directoryRobert Griesemer18-618/+617
R=rsc http://codereview.appspot.com/172041
2009-12-09added benchmarks to rand_test.go;Roger Peppe1-0/+15
removed superfluous field name in lockedSource. R=r, rsc http://codereview.appspot.com/170043 Committer: Russ Cox <rsc@golang.org>
2009-12-09syscalls can return negative i/o counts. fix bugs in ReadAt and WriteAt not ↵Rob Pike1-2/+2
to include negative counts in return values. R=rsc CC=golang-dev http://codereview.appspot.com/170044
2009-12-09Make the operations on the global rng thread safe.Roger Peppe1-1/+21
R=r, rsc CC=golang-dev http://codereview.appspot.com/168041 Committer: Russ Cox <rsc@golang.org>
2009-12-09json package: Fixed handling of nil valuesRoss Light2-1/+15
Fixes issue 400. R=golang-dev, rsc http://codereview.appspot.com/167058 Committer: Russ Cox <rsc@golang.org>
2009-12-09Added XTEA block cipher package to src/pkg/cryptoAdrian O'Grady5-0/+417
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 http://codereview.appspot.com/157152 Committer: Russ Cox <rsc@golang.org>
2009-12-08runtime: start new darwin/amd64 threads on correct stack,Russ Cox1-11/+13
then enable stack check. R=r http://codereview.appspot.com/165100
2009-12-08bufio: use copy - significant speedup for writersRuss Cox1-12/+6
R=r http://codereview.appspot.com/167047
2009-12-08Fix stack on FreeBSD / add stack check across the boardDevon H. O'Dell8-10/+36
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 http://codereview.appspot.com/167055 Committer: Russ Cox <rsc@golang.org>
2009-12-08When SA_SIGINFO is set, we should use __sa_sigaction on FreeBSDDevon H. O'Dell2-4/+4
R=rsc CC=golang-dev http://codereview.appspot.com/165097 Committer: Russ Cox <rsc@golang.org>
2009-12-07runtime: don't touch pages of memory unnecessarily.Russ Cox8-45/+15
cuts working size for hello world from 6 MB to 1.2 MB. still some work to be done, but diminishing returns. R=r http://codereview.appspot.com/165080
2009-12-07runtime: introduce unsafe.New and unsafe.NewArrayRuss Cox5-38/+75
to provide functionality previously hacked in to reflect and gob. R=r http://codereview.appspot.com/165076
2009-12-07use a bootstrap array to avoid allocation for short vectorsRobert Griesemer2-16/+30
R=r http://codereview.appspot.com/165078
2009-12-07Remove copyBytes completely in favor of copy.Christopher Wedgwood1-11/+2
R=r, rsc http://codereview.appspot.com/165068 Committer: Rob Pike <r@golang.org>
2009-12-07pick off special one-byte case in copy. worth 2x in benchmarks (38ns->16ns).Rob Pike1-1/+5
the one-item case could be generalized easily with no cost. worth considering. R=rsc CC=golang-dev, cw http://codereview.appspot.com/167044
2009-12-07the AST walker currently provides no way to find out how theRoger Peppe1-54/+55
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 http://codereview.appspot.com/166047 Committer: Robert Griesemer <gri@golang.org>
2009-12-06save a few ns by inlining (which mostly simplifies things anyway).Rob Pike2-114/+100
a couple of cleanups. don't keep big buffers in the free list. R=rsc CC=golang-dev http://codereview.appspot.com/166078
2009-12-06unexport Fmt. it's not needed outside this package any moreRob Pike2-205/+179
cleans up godoc's output for package fmt substantially. R=rsc CC=golang-dev http://codereview.appspot.com/165070
2009-12-06Make printing faster by avoiding mallocs and some other advances.Rob Pike4-415/+423
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 http://codereview.appspot.com/166076
2009-12-06runtime: disable pointer scan optimizationRuss Cox1-1/+3
* broken by reflect, gob TBR=r http://codereview.appspot.com/166077
2009-12-04Fix syscall.Statfs and syscall.Fstatfs for 386 GNU/Linux.Ian Lance Taylor2-14/+12
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 http://codereview.appspot.com/166073
2009-12-04gc/runtime: pass type structure to makeslice.Russ Cox3-13/+86
* 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 http://codereview.appspot.com/165064
2009-12-04net: more fiddling with the udp test.Russ Cox1-1/+1
i don't know why the timeout needs to be so big. R=r http://codereview.appspot.com/165063
2009-12-04Add syscall.Rename for NaCl. Fixes NaCl build.Ian Lance Taylor1-0/+4
R=rsc http://codereview.appspot.com/165062