Use methods for key questions.
Provide access to non-portable pieces through portable methods.
Windows and Plan 9 updated.
R=golang-dev, bradfitz, bradfitz, r, dsymonds, rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5673077
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.
Fixes#1304.
R=ken2
CC=golang-dev
https://golang.org/cl/5687046
They are portability problems and the options are almost always zero in practice anyway.
R=golang-dev, dsymonds, r, bradfitz
CC=golang-dev
https://golang.org/cl/5688046
-- 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
Fixes#2842
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5674084
While we're here, get rid of the old names for the escaping functions.
Fixes#3073.
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5685049
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.
Fixes#2894 (I hope).
R=golang-dev, bradfitz, nigeltao
CC=golang-dev
https://golang.org/cl/5685046
ARM doesn't have the concept of scale, so I renamed the field
Addr.scale to Addr.flag to better reflect its true meaning.
R=rsc
CC=golang-dev
https://golang.org/cl/5687044
* 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
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
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.
R=ken2
CC=golang-dev
https://golang.org/cl/5671099
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.
Fixing them is issue 3069.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656102
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.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5677092
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.
Fixes#3026.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5675087
Fix by setting the element type if we discover it's zero while building.
We could have fixed this better with foresight by doing the id setting in a
different sequence, but doing that now would break binary compatibility.
Fixes#2995.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5675083
I am making a unilateral decision here. I could also settle for returning 0,
as long it's documented, but I argue that it's equivalent to an index
out of bounds.
Fixes#2892.
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5676079
1, strip last path separator from $GOROOT
The user might define GOROOT=/path/to/go/, but then the dir
check in defaulttarg() will always complain the current dir
is not within $GOROOT/src/.
2, resolve symlinks in the default goroot
Or if getcwd() returns a fully-resolved path, the check in
defaulttarg() will always fail.
R=rsc
CC=golang-dev
https://golang.org/cl/5649073
The panic happens if -benchtime flag is specified:
go test -bench=EndToEndAsyncHTTP -benchtime=120
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5677075
Convert cryptotype to general go1rename fix.
Add os.Exec -> syscall.Exec fix along with new
URL fixes.
Fixes#2946.
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/5672072
We want to be able to implement good Windows support
after Go 1. Right now Windows tries to use Unix domain
sockets, and I'd rather just have it not be available.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5671076
The set of errors forwarded by the os package varied with system and
was therefore non-portable.
Three helpers added for portable error checking: IsExist, IsNotExist, and IsPermission.
One or two more may need to come, but let's keep the set very small to discourage
thinking about errors that way.
R=mikioh.mikioh, gustavo, r, rsc
CC=golang-dev
https://golang.org/cl/5672047
It was being skipped due to an oversight.
Also adjust naming parameters for map type construction - makes debugging easier.
Prelude to issue 3026.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5674071
Clang 3.1 has more warnings enabled by default than GCC.
Combined with -Werror, they cause the build to fail
unnecessarily. if the name of our compiler ends in "clang",
add the necessary extra -Wno options. Ideally we would add
these flags unconditionally, as GCC is supposed to ignore
unknown -Wno flags, but apple's llvm-gcc doesn't.
Fixes#2878.
R=rsc, dave
CC=golang-dev
https://golang.org/cl/5673055
Periodically browse MHeap's freelists for long unused spans and release them if any.
Current hardcoded settings:
- GC is forced if none occured over the last 2 minutes.
- spans are handed back after 5 minutes of uselessness.
SysUnused (for Unix) is a wrapper on madvise MADV_DONTNEED on Linux and MADV_FREE on BSDs.
R=rsc, dvyukov, remyoudompheng
CC=golang-dev
https://golang.org/cl/5451057
An unindented XML example is hard to follow. MarshalIndent
allows moving the example over to a test file (and fixing it).
R=golang-dev, r, gustavo, r, rsc
CC=golang-dev
https://golang.org/cl/5674050
It depended on old behavior of functions in structs.
Solved by adding a boolean method to check .Run != nil.
R=golang-dev, adg, r, rsc
CC=golang-dev
https://golang.org/cl/5674062