Brad Fitzpatrick [Wed, 22 Feb 2012 00:13:59 +0000 (11:13 +1100)]
net/textproto: accept bad MIME headers as browsers do
Accept certain non-compliant response headers
(in particular, when spaces preceed the colon).
All major browser and curl seem to support this,
and at least one webserver seems to send these.
Marcel van Lohuizen [Tue, 21 Feb 2012 12:13:21 +0000 (13:13 +0100)]
exp/norm: Added Iter type for iterating on segment boundaries. This type is mainly to be used
by other low-level libraries, like collate. Extra care has been given to optimize the performance
of normalizing to NFD, as this is what will be used by the collator. The overhead of checking
whether a string is normalized vs simply decomposing a string is neglible. Assuming that most
strings are in the FCD form, this iterator can be used to decompose strings and normalize with
minimal overhead.
Rob Pike [Tue, 21 Feb 2012 03:10:34 +0000 (14:10 +1100)]
os: replace non-portable Waitmsg with portable ProcessState
Use methods for key questions.
Provide access to non-portable pieces through portable methods.
Windows and Plan 9 updated.
Russ Cox [Mon, 20 Feb 2012 18:41:44 +0000 (13:41 -0500)]
5g, 6g, 8g: flush modified globals aggressively
The alternative is to record enough information that the
trap handler know which registers contain cached globals
and can flush the registers back to their original locations.
That's significantly more work.
This only affects globals that have been written to.
Code that reads from a global should continue to registerize
as well as before.
Brad Fitzpatrick [Mon, 20 Feb 2012 10:49:58 +0000 (02:49 -0800)]
build: remove old version*.go files from hgignore
This broke a build on a Linux box I hadn't updated
in awhile. The hgignore files were preventing hg status
from showing and hg purge from cleaning up junk.
Joe Poirier [Mon, 20 Feb 2012 06:29:57 +0000 (00:29 -0600)]
misc/dist/windows: ongoing dev
Embedded Go images in the installer dialog and
banner boxes, Go tree cloning uses version info
from the Go tool (readme updated), the installer
allows up/down-grading and reparing of the version
that's installed, added two registry values.
Joe Poirier [Mon, 20 Feb 2012 04:21:41 +0000 (22:21 -0600)]
misc/dist/windows: ongoing dev
Added the (properly formatted) license file back,
the installer adds go\bin to the system PATH now,
the output package names are in line with the linux
and darwin versions, dist.bat extracts GOARCH in a
sane way, readme cleanup.
Tested on Windows 7 only. It would be helpful if
someone else could give it a try. See the readme
for details.
Brad Fitzpatrick [Mon, 20 Feb 2012 03:25:28 +0000 (14:25 +1100)]
database/sql/driver: API cleanups
-- add driver.Value type and documentation,
convert from interface{} to Value where
appropriate.
-- don't say "subset" anywhere,
-- SubsetValuer -> Valuer
-- SubsetValue -> Value
-- IsParameterSubsetType -> IsValue
-- IsScanSubsetType -> IsScanValue
Russ Cox [Mon, 20 Feb 2012 03:13:04 +0000 (22:13 -0500)]
strconv: run garbage collection before counting allocations in test
My theory is that the call to f() allocates, which triggers
a garbage collection, which itself may do some allocation,
which is being counted. Running a garbage collection
before starting the test should avoid this problem.
Shenghou Ma [Sun, 19 Feb 2012 23:11:16 +0000 (18:11 -0500)]
5a, 5c, 5g, 5l: fix build for Linux/ARM.
ARM doesn't have the concept of scale, so I renamed the field
Addr.scale to Addr.flag to better reflect its true meaning.
Russ Cox [Sun, 19 Feb 2012 18:32:55 +0000 (13:32 -0500)]
cmd/cgo: bug fixes
* disallow embedding of C type (Fixes issue 2552)
* detect 0-length array (Fixes issue 2806)
* use typedefs when possible, to avoid attribute((unavailable)) (Fixes issue 2888)
* print Go types constructed from C types using original C types (Fixes issue 2612)
This fix changes _cgo_export.h to repeat the preamble from import "C".
Otherwise the fix to issue 2612 is impossible, since it cannot refer to
types that have not been defined. If people are using //export and
putting non-header information in the preamble, they will need to
refactor their code.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5672080
Russ Cox [Sun, 19 Feb 2012 16:05:19 +0000 (11:05 -0500)]
runtime: fix another memory leak
morebuf holds a pc/sp from the last stack split or
reflect.call or panic/recover. If the pc is a closure,
the reference will keep it from being collected.
moreargp holds a pointer to the arguments from the
last stack split or reflect.call or panic/recover.
Normally it is a stack pointer and thus not of interest,
but in the case of reflect.call it is an allocated argument
list and holds up the arguments to the call.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5674109
Russ Cox [Sun, 19 Feb 2012 08:19:52 +0000 (03:19 -0500)]
gc, ld: tag data as no-pointers and allocate in separate section
The garbage collector can avoid scanning this section, with
reduces collection time as well as the number of false positives.
Helps a little bit with issue 909, but certainly does not solve it.
Russ Cox [Sun, 19 Feb 2012 05:27:05 +0000 (00:27 -0500)]
encoding/json: disable anonymous fields
We should, after Go 1, make them work the same as
package xml, that is, make them appear in the outer
struct. For now turn them off so that people do not
depend on the old behavior.
Russ Cox [Sun, 19 Feb 2012 05:26:33 +0000 (00:26 -0500)]
runtime: fix tiny memory leak
The m->cret word holds the C return value when returning
across a stack split boundary. It was not being cleared after
use, which means that the return value (if a C function)
or else the value of AX/R0 at the time of the last stack unsplit
was being kept alive longer than necessary. Clear it.
I think the effect here should be very small, but worth fixing
anyway.
Rob Pike [Sun, 19 Feb 2012 02:19:43 +0000 (13:19 +1100)]
test: [a-c]: add introductory comments to tests
Very few of the compiler regression tests include a comment
saying waht they do. Many are obvious, some are anything but.
I've started with a-c in the top directory. More will follow once
we agree on the approach, correctness, and thoroughness here.
zerodivide.go sneaked in too.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5656100
Rob Pike [Sat, 18 Feb 2012 03:38:37 +0000 (14:38 +1100)]
encoding/gob: cache engine for user type, not base type
When we build the encode engine for a recursive type, we
mustn't disregard the indirections or we can try to reuse an
engine at the wrong indirection level.