summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* runtime: fix endianness assumption when decoding ftabAustin Clements2014-10-271-4/+7
| | | | | | | | | | | | | The ftab ends with a half functab record consisting only of the 'entry' field followed by a uint32 giving the offset of the next table. Previously, symtabinit assumed it could read this uint32 as a uintptr. Since this is unsafe on big endian, explicitly read the offset as a uint32. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/157660043
* net: if a DNS lookup times out, forget that it is in flightIan Lance Taylor2014-10-272-28/+89
| | | | | | | | | | | | | | | | | | | | | | | | Before this CL, if the system resolver does a very slow DNS lookup for a particular host, all subsequent requests for that host will hang waiting for that lookup to complete. That is more or less expected when Dial is called with no deadline. When Dial has a deadline, though, we can accumulate a large number of goroutines waiting for that slow DNS lookup. Try to avoid this problem by restarting the DNS lookup when it is redone after a deadline is passed. This CL also avoids creating an extra goroutine purely to handle the deadline. No test because we would have to simulate a slow DNS lookup followed by a fast DNS lookup. Fixes issue 8602. LGTM=bradfitz R=bradfitz, mikioh.mikioh CC=golang-codereviews, r, rsc https://codereview.appspot.com/154610044
* misc/makerelease/windows: fix 404 help URL in installerEmil Hessman2014-10-271-3/+3
| | | | | | | | | | | | | ARPHELPLINK yields 404; update the URL. While here, also prefix the ARPREADME and ARPURLINFOABOUT URL's with the HTTP scheme to make 'em clickable links in the Add or Remove Programs listing. LGTM=adg R=golang-codereviews CC=adg, golang-codereviews https://codereview.appspot.com/154580045 Committer: Andrew Gerrand <adg@golang.org>
* doc/go_faq.html: fix a couple of nitsRob Pike2014-10-261-2/+2
| | | | | | | | | Wrong article, one stylistic point that bothers someone (but not me). LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/156680043
* cmd/go: pass $CGO_LDFLAGS to linker with the "gccgo" toolchain.Peter Collingbourne2014-10-251-0/+1
| | | | | | | | | LGTM=iant R=iant, minux CC=golang-codereviews, golang-dev https://codereview.appspot.com/157460043 Committer: Ian Lance Taylor <iant@golang.org>
* cmd/go: add bzr support for vcs root checkingGustavo Niemeyer2014-10-242-5/+56
| | | | | | | | | Complements the logic introduced in CL 147170043. LGTM=rsc R=rsc, gustavo CC=golang-codereviews https://codereview.appspot.com/147240043
* doc/go1.4.txt: unsafe is outside go1 compatibility guaranteesRob Pike2014-10-241-1/+2
| | | | | CC=golang-codereviews https://codereview.appspot.com/164770043
* unsafe: document that unsafe programs are not protectedRob Pike2014-10-242-0/+11
| | | | | | | | | | | | The compatibility guideline needs to be clear about this even though it means adding a clause that was not there from the beginning. It has always been understood, so this isn't really a change in policy, just in its expression. LGTM=bradfitz, gri, rsc R=golang-codereviews, bradfitz, gri, rsc CC=golang-codereviews https://codereview.appspot.com/162060043
* net/http/pprof: run GC for /debug/pprof/heap?gc=1Russ Cox2014-10-241-0/+4
| | | | | | | | | | | | | | | | We force runtime.GC before WriteHeapProfile with -test.heapprofile. Make it possible to do the same with the HTTP interface. Some servers only run a GC every few minutes. On such servers, the heap profile will be a few minutes stale, which may be too old to be useful. Requested by private mail. LGTM=dvyukov R=dvyukov CC=golang-codereviews https://codereview.appspot.com/161990043
* cmd/gc: synthesize zeroed value for non-assignment contextRuss Cox2014-10-242-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CL 157910047 introduced code to turn a node representing a zeroed composite literal into N, the nil Node* pointer (which represents any zero, not the Go literal nil). That's great for assignments like x = T{}, but it doesn't work when T{} is used in a value context like T{}.v or x == T{}. Fix those. Should have no effect on performance; confirmed. The deltas below are noise (compare ns/op): benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 2902919192 2915228424 +0.42% BenchmarkFannkuch11 2597417605 2630363685 +1.27% BenchmarkFmtFprintfEmpty 73.7 74.8 +1.49% BenchmarkFmtFprintfString 196 199 +1.53% BenchmarkFmtFprintfInt 213 217 +1.88% BenchmarkFmtFprintfIntInt 336 356 +5.95% BenchmarkFmtFprintfPrefixedInt 289 294 +1.73% BenchmarkFmtFprintfFloat 415 416 +0.24% BenchmarkFmtManyArgs 1281 1271 -0.78% BenchmarkGobDecode 10271734 10307978 +0.35% BenchmarkGobEncode 8985021 9079442 +1.05% BenchmarkGzip 410233227 412266944 +0.50% BenchmarkGunzip 102114554 103272443 +1.13% BenchmarkHTTPClientServer 45297 44993 -0.67% BenchmarkJSONEncode 19499741 19498489 -0.01% BenchmarkJSONDecode 76436733 74247497 -2.86% BenchmarkMandelbrot200 4273814 4307292 +0.78% BenchmarkGoParse 4024594 4028937 +0.11% BenchmarkRegexpMatchEasy0_32 131 135 +3.05% BenchmarkRegexpMatchEasy0_1K 328 333 +1.52% BenchmarkRegexpMatchEasy1_32 115 117 +1.74% BenchmarkRegexpMatchEasy1_1K 931 948 +1.83% BenchmarkRegexpMatchMedium_32 216 217 +0.46% BenchmarkRegexpMatchMedium_1K 72669 72857 +0.26% BenchmarkRegexpMatchHard_32 3818 3809 -0.24% BenchmarkRegexpMatchHard_1K 121398 121945 +0.45% BenchmarkRevcomp 613996550 615145436 +0.19% BenchmarkTemplate 93678525 93267391 -0.44% BenchmarkTimeParse 414 411 -0.72% BenchmarkTimeFormat 396 399 +0.76% Fixes issue 8947. LGTM=r R=r, dave CC=golang-codereviews https://codereview.appspot.com/162130043
* doc/go1.4: encoding/csvRuss Cox2014-10-241-0/+1
| | | | | CC=golang-codereviews https://codereview.appspot.com/162140043
* encoding/csv: for Postgres, unquote empty strings, quote \.Russ Cox2014-10-232-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In theory both of these lines encode the same three fields: a,,c a,"",c However, Postgres defines that when importing CSV, the unquoted version is treated as NULL (missing), while the quoted version is treated as a string value (empty string). If the middle field is supposed to be an integer value, the first line can be imported (NULL is okay), but the second line cannot (empty string is not). Postgres's import command (COPY FROM) has an option to force the unquoted empty to be interpreted as a string but it does not have an option to force the quoted empty to be interpreted as a NULL. From http://www.postgresql.org/docs/9.0/static/sql-copy.html: The CSV format has no standard way to distinguish a NULL value from an empty string. PostgreSQL's COPY handles this by quoting. A NULL is output as the NULL parameter string and is not quoted, while a non-NULL value matching the NULL parameter string is quoted. For example, with the default settings, a NULL is written as an unquoted empty string, while an empty string data value is written with double quotes (""). Reading values follows similar rules. You can use FORCE_NOT_NULL to prevent NULL input comparisons for specific columns. Therefore printing the unquoted empty is more flexible for imports into Postgres than printing the quoted empty. In addition to making the output more useful with Postgres, not quoting empty strings makes the output smaller and easier to read. It also matches the behavior of Microsoft Excel and Google Drive. Since we are here and making concessions for Postgres, handle this case too (again quoting the Postgres docs): Because backslash is not a special character in the CSV format, \., the end-of-data marker, could also appear as a data value. To avoid any misinterpretation, a \. data value appearing as a lone entry on a line is automatically quoted on output, and on input, if quoted, is not interpreted as the end-of-data marker. If you are loading a file created by another application that has a single unquoted column and might have a value of \., you might need to quote that value in the input file. Fixes issue 7586. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/164760043
* spec: minimal documention of unsafe.Pointer conversionsRobert Griesemer2014-10-231-5/+6
| | | | | | | | | | | | Per suggestion from rsc as a result of the dicussion of (abandoned) CL 153110044. Fixes issue 7192. LGTM=r, rsc, iant R=r, rsc, iant, ken CC=golang-codereviews https://codereview.appspot.com/163050043
* gccgo_install.html: the 4.9 release series supports Go 1.2Ian Lance Taylor2014-10-221-0/+4
| | | | | | | LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/163760043
* sync: release Pool memory during second and later GCsDmitriy Vyukov2014-10-222-21/+35
| | | | | | | | | | | | | | | | | | Pool memory was only being released during the first GC after the first Put. Put assumes that p.local != nil means p is on the allPools list. poolCleanup (called during each GC) removed each pool from allPools but did not clear p.local, so each pool was cleared by exactly one GC and then never cleared again. This bug was introduced late in the Go 1.3 release cycle. Fixes issue 8979. LGTM=rsc R=golang-codereviews, bradfitz, r, rsc CC=golang-codereviews, khr https://codereview.appspot.com/162980043
* test: add more cases to recover.goIan Lance Taylor2014-10-221-3/+41
| | | | | | | | | | test16 used to fail with gccgo. The withoutRecoverRecursive test would have failed in some possible implementations. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/151630043
* CONTRIBUTORS: add Austin Clements's google.com email (Google CLA)Russ Cox2014-10-221-1/+1
| | | | | | | LGTM=bradfitz, austin R=austin CC=bradfitz, golang-codereviews https://codereview.appspot.com/158330045
* runtime/cgo: encode BLX directly, fixes one clang build error on armDave Cheney2014-10-221-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 8348. Trying to work around clang's dodgy support for .arch by reverting to the external assembler didn't work out so well. Minux had a much better solution to encode the instructions we need as .word directives which avoids .arch altogether. I've confirmed with gdb that this form produces the expected machine code Dump of assembler code for function crosscall_arm1: 0x00000000 <+0>: push {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr} 0x00000004 <+4>: mov r4, r0 0x00000008 <+8>: mov r5, r1 0x0000000c <+12>: mov r0, r2 0x00000010 <+16>: blx r5 0x00000014 <+20>: blx r4 0x00000018 <+24>: pop {r4, r5, r6, r7, r8, r9, r10, r11, r12, pc} There is another compilation failure that blocks building Go with clang on arm # ../misc/cgo/test # _/home/dfc/go/misc/cgo/test /tmp/--407b12.s: Assembler messages: /tmp/--407b12.s:59: Error: selected processor does not support ARM mode `blx r0' clang: error: assembler command failed with exit code 1 (use -v to see invocation) FAIL _/home/dfc/go/misc/cgo/test [build failed] I'll open a new issue for that LGTM=iant R=iant, minux CC=golang-codereviews https://codereview.appspot.com/158180047
* misc/makerelease: set version number in Windows installerJens Frederich2014-10-222-4/+20
| | | | | | | | | | | | | | | | | | | | Set correct version number at Windows installer based on Go's Mercurial tag. Name | Version ------------------------------------------------ Go Programming Language amd64 go1.3.3 | 1.3.3 Go Programming Language amd64 go1.2rc3 | 1.2 Go Programming Language amd64 go1.2beta1 | 1.2 Fixes issue 8239. LGTM=adg R=adg, c.emil.hessman, alex.brainman CC=golang-codereviews https://codereview.appspot.com/160950044 Committer: Andrew Gerrand <adg@golang.org>
* undo CL 156430044 / 5d69cad4faafDave Cheney2014-10-211-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Partial undo, changes to ldelf.c retained. Some platforms are still not working even with the integrated assembler disabled, will have to find another solution. ??? original CL description cmd/cgo: disable clang's integrated assembler Fixes issue 8348. Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used). This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim. This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/156430044 ??? LGTM=minux R=iant, minux CC=golang-codereviews https://codereview.appspot.com/162880044
* runtime: warn that cputicks() might not be monotonic.Keith Randall2014-10-215-23/+4
| | | | | | | | | Get rid of gocputicks(), it is no longer used. LGTM=bradfitz, dave R=golang-codereviews, bradfitz, dave, minux CC=golang-codereviews https://codereview.appspot.com/161110044
* cmd/ld: fix addstrdata for big-endian systemsIan Lance Taylor2014-10-211-3/+1
| | | | | | | LGTM=rsc R=minux, rsc CC=golang-codereviews https://codereview.appspot.com/158280043
* time: panic with a more helpful error on use of invalid TimerBrad Fitzpatrick2014-10-212-0/+27
| | | | | | | | | Fixes Issue 8721 LGTM=rsc R=r, rsc CC=golang-codereviews https://codereview.appspot.com/155620045
* cmd/gc: disallow call of *T method using **T variableRuss Cox2014-10-202-5/+8
| | | | | | | | | | | | | | | This brings cmd/gc in line with the spec on this question. It might break existing code, but that code was not conformant with the spec. Credit to R?my for finding the broken code. Fixes issue 6366. LGTM=r R=golang-codereviews, r CC=adonovan, golang-codereviews, gri https://codereview.appspot.com/129550043
* compress/gzip: allow stopping at end of first streamRuss Cox2014-10-202-0/+68
| | | | | | | | | | | | | | | Allows parsing some file formats that assign special meaning to which stream data is found in. Will do the same for compress/bzip2 once this is reviewed and submitted. Fixes issue 6486. LGTM=nigeltao R=nigeltao, dan.kortschak CC=adg, bradfitz, golang-codereviews, r https://codereview.appspot.com/159120044
* cmd/cgo: disable clang's integrated assemblerDave Cheney2014-10-202-2/+8
| | | | | | | | | | | | | | | Fixes issue 8348. Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used). This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim. This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/156430044
* debug/pe: use appropriate type for sizeofOptionalHeader32Alex Brainman2014-10-211-3/+3
| | | | | | | LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://codereview.appspot.com/157220043
* runtime: fix flaky TestBlockProfile testKeith Randall2014-10-201-1/+3
| | | | | | | | | | | | | | | It has been failing periodically on Solaris/x64. Change blockevent so it always records an event if we called SetBlockProfileRate(1), even if the time delta is negative or zero. Hopefully this will fix the test on Solaris. Caveat: I don't actually know what the Solaris problem is, this is just an educated guess. LGTM=dave R=dvyukov, dave CC=golang-codereviews https://codereview.appspot.com/159150043
* runtime: handle non-nil-terminated environment strings on Plan 9David du Colombier2014-10-201-1/+5
| | | | | | | | | | Russ Cox pointed out that environment strings are not required to be nil-terminated on Plan 9. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/159130044
* os/exec: fix number of expected file descriptors on Plan 9David du Colombier2014-10-201-9/+1
| | | | | | | | | | Since CL 104570043 and 112720043, we are using the nsec system call instead of /dev/bintime on Plan 9. LGTM=rsc R=rsc CC=aram, golang-codereviews https://codereview.appspot.com/155590043
* flag: roll back 156390043 (flag setting)Rob Pike2014-10-202-89/+0
| | | | | | | | | | Shell scripts depend on the old behavior too often. It's too late to make this change. LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://codereview.appspot.com/161890044
* cmd/go: set exit status for failing "go generate" run.Rob Pike2014-10-201-1/+3
| | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/154360048
* reflect: fix TestAllocations now that interfaces hold only pointersIan Lance Taylor2014-10-201-3/+14
| | | | | | | | | | This test was failing but did not break the build because it was not run when -test.short was used. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/157150043
* reflect: allocate correct type in assignTo and cvtT2IIan Lance Taylor2014-10-201-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I came across this while debugging a GC problem in gccgo. There is code in assignTo and cvtT2I that handles assignment to all interface values. It allocates an empty interface even if the real type is a non-empty interface. The fields are then set for a non-empty interface, but the memory is recorded as holding an empty interface. This means that the GC has incorrect information. This is extremely unlikely to fail, because the code in the GC that handles empty interfaces looks like this: obj = nil; typ = eface->type; if(typ != nil) { if(!(typ->kind&KindDirectIface) || !(typ->kind&KindNoPointers)) obj = eface->data; In the current runtime the condition is always true--if KindDirectIface is set, then KindNoPointers is clear--and we always want to set obj = eface->data. So the question is what happens when we incorrectly store a non-empty interface value in memory marked as an empty interface. In that case eface->type will not be a *rtype as we expect, but will instead be a pointer to an Itab. We are going to use this pointer to look at a *rtype kind field. The *rtype struct starts out like this: type rtype struct { size uintptr hash uint32 // hash of type; avoids computation in hash tables _ uint8 // unused/padding align uint8 // alignment of variable with this type fieldAlign uint8 // alignment of struct field with this type kind uint8 // enumeration for C An Itab always has at least two pointers, so on a little-endian 64-bit system the kind field will be the high byte of the second pointer. This will normally be zero, so the test of typ->kind will succeed, which is what we want. On a 32-bit system it might be possible to construct a failing case by somehow getting the Itab for an interface with one method to be immediately followed by a word that is all ones. The effect would be that the test would sometimes fail and the GC would not mark obj, leading to an invalid dangling pointer. I have not tried to construct this test. I noticed this in gccgo, where this error is much more likely to cause trouble for a rather random reason: gccgo uses a different layout of rtype, and in gccgo the kind field happens to be the low byte of a pointer, not the high byte. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/155450044
* regexp: fix TestOnePassCutoffRuss Cox2014-10-201-4/+12
| | | | | | | | | | | | | The stack blowout can no longer happen, but we can still test that too-complex regexps are rejected. Replacement for CL 162770043. LGTM=iant, r R=r, iant CC=bradfitz, golang-codereviews https://codereview.appspot.com/162860043
* regexp/syntax: fix validity testing of zero repeatsIan Lance Taylor2014-10-201-1/+6
| | | | | | | | | | This is already tested by TestRE2Exhaustive, but the build has not broken because that test is not run when using -test.short. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/155580043
* debug/pe: remove use of unsafeRuss Cox2014-10-201-3/+7
| | | | | | | | | Helps in environments with restricted support for unsafe. LGTM=bradfitz R=r, bradfitz CC=dsymonds, golang-codereviews https://codereview.appspot.com/156410044
* cmd/gc: emit code for extern = <N>Daniel Morsing2014-10-202-7/+23
| | | | | | | | | | | | | https://codereview.appspot.com/152700045/ made it possible for struct literals assigned to globals to use <N> as the RHS. Normally, this is to zero out variables on first use. Because globals are already zero (or their linker initialized value), we just ignored this. Now that <N> can occur from non-initialization code, we need to emit this code. We don't use <N> for initialization of globals any more, so this shouldn't cause any excessive zeroing. Fixes issue 8961. LGTM=rsc R=golang-codereviews, rsc CC=bradfitz, golang-codereviews https://codereview.appspot.com/154540044
* encoding/gob: add custom decoder buffer for performanceRob Pike2014-10-203-39/+78
| | | | | | | | | | | | | | | | | | | | | | | | | As we did with encoding, provide a trivial byte reader for faster decoding. We can also reduce some of the copying by doing the allocation all at once using a slightly different interface from byte buffers. benchmark old ns/op new ns/op delta BenchmarkEndToEndPipe 13368 12902 -3.49% BenchmarkEndToEndByteBuffer 5969 5642 -5.48% BenchmarkEndToEndSliceByteBuffer 479485 470798 -1.81% BenchmarkEncodeComplex128Slice 92367 92201 -0.18% BenchmarkEncodeFloat64Slice 39990 38960 -2.58% BenchmarkEncodeInt32Slice 30510 27938 -8.43% BenchmarkEncodeStringSlice 33753 33365 -1.15% BenchmarkDecodeComplex128Slice 232278 196704 -15.32% BenchmarkDecodeFloat64Slice 150258 128191 -14.69% BenchmarkDecodeInt32Slice 133806 115748 -13.50% BenchmarkDecodeStringSlice 335117 300534 -10.32% LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/154360049
* doc/go1.4.txt: add compress/* Reset noteBrad Fitzpatrick2014-10-201-0/+1
| | | | | CC=golang-codereviews https://codereview.appspot.com/156430043
* compress/flate: add Reset() to allow reusing large buffers to compress ↵James Robinson2014-10-204-27/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple buffers This adds a Reset() to compress/flate's decompressor and plumbs that through to compress/zlib and compress/gzip's Readers so callers can avoid large allocations when performing many inflate operations. In particular this preserves the allocation of the decompressor.hist buffer, which is 32kb and overwritten as needed while inflating. On the benchmark described in issue 6317, produces the following speedup on my 2.3ghz Intel Core i7 MBP with go version devel +6b696a34e0af Sun Aug 03 15:14:59 2014 -0700 darwin/amd64: blocked.text w/out patch vs blocked.text w/ patch: benchmark old ns/op new ns/op delta BenchmarkGunzip 8371577533 7927917687 -5.30% benchmark old allocs new allocs delta BenchmarkGunzip 176818 148519 -16.00% benchmark old bytes new bytes delta BenchmarkGunzip 292184936 12739528 -95.64% flat.text vs blocked.text w/patch: benchmark old ns/op new ns/op delta BenchmarkGunzip 7939447827 7927917687 -0.15% benchmark old allocs new allocs delta BenchmarkGunzip 90702 148519 +63.74% benchmark old bytes new bytes delta BenchmarkGunzip 9959528 12739528 +27.91% Similar speedups to those bradfitz saw in https://codereview.appspot.com/13416045. Fixes issue 6317. Fixes issue 7950. LGTM=nigeltao R=golang-codereviews, bradfitz, dan.kortschak, adg, nigeltao, jamesr CC=golang-codereviews https://codereview.appspot.com/97140043 Committer: Nigel Tao <nigeltao@golang.org>
* doc/go1.4.txt: flags can now be set at most onceRob Pike2014-10-191-0/+1
| | | | | CC=golang-codereviews https://codereview.appspot.com/161820043
* flag: disallow setting flags multiple timesRob Pike2014-10-192-0/+90
| | | | | | | | | | | | | | | This is a day 1 error in the flag package: It did not check that a flag was set at most once on the command line. Because user-defined flags may have more general properties, the check applies only to the standard flag types in this package: bool, string, etc. Fixes issue 8960. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/156390043
* regexp: correct doc comment for ReplaceAllLiteralStringIan Lance Taylor2014-10-191-1/+1
| | | | | | | | | Fixes issue 8959. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://codereview.appspot.com/161790043
* encoding/gob: fix print format in generated decoder helpersRob Pike2014-10-192-17/+17
| | | | | | | | | Needed a %% to quote a percent in the format. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://codereview.appspot.com/156330043
* runtime: dequeue the correct SudoGKeith Randall2014-10-182-4/+33
| | | | | | | | | | | | | | | | | | | select { case <- c: case <- c: } In this case, c.recvq lists two SudoGs which have the same G. So we can't use the G as the key to dequeue the correct SudoG, as that key is ambiguous. Dequeueing the wrong SudoG ends up freeing a SudoG that is still in c.recvq. The fix is to use the actual SudoG pointer as the key. LGTM=dvyukov R=rsc, bradfitz, dvyukov, khr CC=austin, golang-codereviews https://codereview.appspot.com/159040043
* text/template: fix bug in pipelined variadicsRob Pike2014-10-182-1/+13
| | | | | | | | | | | | | | Simple bug in argument processing: The final arg may be the pipeline value, in which case it gets bound to the fixed argument section. The code got that wrong. Easy to fix. Fixes issue 8950. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/161750043
* encoding/gob: use simple append-only buffer for encodingRob Pike2014-10-174-35/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bytes buffers have more API and are a little slower. Since appending is a key part of the path in encode, using a faster implementation speeds things up measurably. The couple of positive swings are likely garbage-collection related since memory allocation looks different in the benchmark now. I am not concerned by them. benchmark old ns/op new ns/op delta BenchmarkEndToEndPipe 6620 6388 -3.50% BenchmarkEndToEndByteBuffer 3548 3600 +1.47% BenchmarkEndToEndSliceByteBuffer 336678 367980 +9.30% BenchmarkEncodeComplex128Slice 78199 71297 -8.83% BenchmarkEncodeFloat64Slice 37731 32258 -14.51% BenchmarkEncodeInt32Slice 26780 22977 -14.20% BenchmarkEncodeStringSlice 35882 26492 -26.17% BenchmarkDecodeComplex128Slice 194819 185126 -4.98% BenchmarkDecodeFloat64Slice 120538 120102 -0.36% BenchmarkDecodeInt32Slice 106442 107275 +0.78% BenchmarkDecodeStringSlice 272902 269866 -1.11% LGTM=ruiu R=golang-codereviews, ruiu CC=golang-codereviews https://codereview.appspot.com/160990043
* encoding/gob: custom array/slice decodersRob Pike2014-10-177-29/+874
| | | | | | | | | | | | | | | | | Use go generate to write better loops for decoding arrays, just as we did for encoding. It doesn't help as much, relatively speaking, but it's still noticeable. benchmark old ns/op new ns/op delta BenchmarkDecodeComplex128Slice 202348 184529 -8.81% BenchmarkDecodeFloat64Slice 135800 120979 -10.91% BenchmarkDecodeInt32Slice 121200 105149 -13.24% BenchmarkDecodeStringSlice 288129 278214 -3.44% LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/154420044
* runtime/pprof: fix memory profiler testDmitriy Vyukov2014-10-171-69/+21
| | | | | | | | | | | Don't use cmd/pprof as it is not necessary installed and does not work on nacl and plan9. Instead just look at the raw profile. LGTM=crawshaw, rsc R=golang-codereviews, crawshaw, 0intro, rsc CC=golang-codereviews https://codereview.appspot.com/159010043