This change extends goinstall to support "magic" package names of the
form:
<host>/<repo>.<vcs>/<path>
Where <host> is the hostname, <repo> the path to the repository, <vcs>
the type of vcs (git, hg, bzr or svn), and <path> is the path inside the
repository that contains the source code for the package.
For example: "example.com/pub/foo.hg/src" means download the Mercurial
repository at either pub/foo.hg or pub/foo from example.com and then
build and install the source files from src inside the repository
checkout.
Repositories on the built-in hostings sites (github, bitbucket,
launchpad and googlecode) must still use the old form (i.e.
github.com/xxx/yyy.git/src will be rejected).
R=adg, rsc
CC=golang-dev
https://golang.org/cl/4626064
Each package using struct field tags assumes that
it is the only package storing data in the tag.
This CL adds support in package reflect for sharing
tags between multiple packages. In this scheme, the
tags must be of the form
key:"value" key2:"value2"
(raw strings help when writing that tag in Go source).
reflect.StructField's Tag field now has type StructTag
(a string type), which has method Get(key string) string
that returns the associated value.
Clients of json and xml will need to be updated.
Code that says
type T struct {
X int "name"
}
should become
type T struct {
X int `json:"name"` // or `xml:"name"`
}
Use govet to identify struct tags that need to be changed
to use the new syntax.
R=r, r, dsymonds, bradfitz, kevlar, fvbommel, n13m3y3r
CC=golang-dev
https://golang.org/cl/4645069
Also reuse of *Regexp nodes.
I believe this is the end of the parser.
The only non-execution code that remains is
the code to expand x{3,5} into simpler operations.
R=sam.thorogood, r
CC=golang-dev
https://golang.org/cl/4629078
The decision for when to say "hash/crc32".New instead of
crc32.New in an error was double-counting imports
from different packages or indirect imports, so it was
quoting even when there was no ambiguity.
R=ken2
CC=golang-dev
https://golang.org/cl/4645070
The gosymtab and gopclntab sections were pointing to the proper
data, but that data was already owned by the rodata section.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.
The data for these sections was moved to after rodata, and the
gosymtab and gopclntab sections now own their respective ranges.
This change makes strip happy both with and without -s being
provided at link time. Note that it won't remove these sections
because they are still allocated, and that's by design since
they are necessary at runtime for generating proper backtraces
and similar introspection operations.
Unlike the previous behavior, -s will now maintain zero-sized
gosymtab and gopclntab sections. This makes the implementation
slightly cleaner.
Fixes#1242.
NOTE: Tested on Linux amd64/386/arm only.
R=ality, rsc
CC=golang-dev
https://golang.org/cl/4639077
The public godoc looked confused. I imagine these were
written before current conventions were established.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4662060
The implementation does not grab the lock,
if Once is already initalized.
Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz)
are as follows:
benchmark old ns/op new ns/op delta
sync_test.BenchmarkOnce 187.00 14.00 -92.51%
sync_test.BenchmarkOnce-2 909.00 21.40 -97.65%
sync_test.BenchmarkOnce-4 3684.00 20.90 -99.43%
sync_test.BenchmarkOnce-8 5987.00 23.00 -99.62%
sync_test.BenchmarkOnce-16 5051.00 21.60 -99.57%
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4641066
including evaluation up the data tree (in this code all fields must be
in dot itself), plus more control structure, but the basics are in place.
R=rsc, r
CC=golang-dev
https://golang.org/cl/4665041
For both contended and uncontended case:
- support arbitrary number of cpus (not just 2)
- dynamic load balancing (improves stability)
- periodic execution of Gosched() to work around non-preemptiviness
For uncontended case eliminates possible false-sharing.
For contended case includes additional variation with some
amount of local work between mutex operations.
R=r, rsc
CC=golang-dev
https://golang.org/cl/4634093
This avoids allocation when writing to bytes.Buffers and bufio.Writers, for
example.
R=golang-dev, rsc, r, consalus, r
CC=golang-dev
https://golang.org/cl/4625068
#pragma varargck countpos f 1
says that the first argument to f is
the count of variadic arguments that follow.
#pragma varargck type f t
says that t is one of the allowed types for
a variadic argument to f.
(can be repeated)
combined, these can be used to check the
runtime.stdcall functions in the windows port
or in any other port that needs a vararg list of
uintptrs even on a 64-bit platform (where it is
very easy to pass a less-than-uintptr in the ...).
demo:
typedef unsigned int uintptr;
#pragma varargck countpos f 1
#pragma varargck type f uintptr
#pragma varargck type f void*
int f(int count, ...);
void *v;
char *p;
void
main(void)
{
f(1, v); // ok
f(1, main); // ok
f(1, p); // ok
f(2, v, v); // ok
f(2, v); // found 1 argument after count 2
f(1, 'a'); // invalid type INT in call to f
f(1, 0); // invalid type INT in call to f
}
R=ken, r, alex.brainman
CC=golang-dev
https://golang.org/cl/4634103
Change the signature of Split to have no count,
assuming a full split, and rename the existing
Split with a count to SplitN.
Do the same to package bytes.
Add a gofix module.
R=adg, dsymonds, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4661051