Robert Griesemer [Tue, 1 Feb 2011 20:02:49 +0000 (12:02 -0800)]
go spec: follow-up cleanups after communication operator changes
These are syntactical changes to better reflect the communication
operator's new status in the language.
- sending to a channel is now done via a send statement
- there is no binary communication operation anymore which
leads to a reduction of the number of precedence levels
from 6 to 5 (yeah!)
- small semantic change: since a send operation is not part
of the expression syntax anymore, a <- send operator is
binding weaker than any other operator now
- receiving from a channel is done as before via the unary
receive expression
- communication clauses in select statement now can contain
send statements or receive expressions
Gustavo Niemeyer [Tue, 1 Feb 2011 17:12:51 +0000 (12:12 -0500)]
exec: use custom error for LookPath
Make the error message and the needed action more obvious
when a command isn't found to obtain the source code
of a project. Users seem to strugle with the existing
wording in practice.
Hector Chu [Tue, 1 Feb 2011 16:49:24 +0000 (11:49 -0500)]
windows: multiple improvements and cleanups
The callback mechanism has been made more flexible.
Eliminated one round of argument copying in Syscall.
Faster Get/SetLastError implemented.
Added gettime for gc perf profiling.
Adam Langley [Tue, 1 Feb 2011 16:02:48 +0000 (11:02 -0500)]
crypto: add package.
The crypto package is added as a common place to store identifiers for
hash functions. At the moment, the rsa package has an enumeration of
hash functions and knowledge of their digest lengths. This is an
unfortunate coupling and other high level crypto packages tend to need
to duplicate this enumeration and knowledge (i.e. openpgp).
crypto pulls this code out into a common location.
It would also make sense to add similar support for ciphers to crypto,
but the problem there isn't as acute that isn't done in this change.
Gustavo Niemeyer [Tue, 1 Feb 2011 00:12:45 +0000 (11:12 +1100)]
misc/vim: Document better syntax sync parameter
Forcing the synchronization of 500 lines is both slower and
less precise than searching for a known sync point.
Unfortunately, though, the way to synchronize correctly is
using the grouphere instruction, which has a bug.
I've already proposed the fix to Vim, so future releases
should have this working. We can continue using the 500 lines
syncing for now.
This change just documents the proper way to sync.
Roger Peppe [Mon, 31 Jan 2011 19:31:34 +0000 (14:31 -0500)]
cgo: improve error reporting slightly.
If there were warnings or errors in the user code,
cgo would print the first error from gcc and then stop,
which is not helpful.
This CL makes cgo ignore errors from user code
in the first pass - they will be shown later.
It also prints errors from user preamble code
with the correct line numbers.
(Also fixed misleading usage message).
Russ Cox [Fri, 28 Jan 2011 22:17:38 +0000 (17:17 -0500)]
runtime: select bug
The sanity checking in pass 2 is wrong
when a select is offering to communicate in
either direction on a channel and neither case
is immediately ready.
Russ Cox [Fri, 28 Jan 2011 20:03:26 +0000 (15:03 -0500)]
runtime: simpler heap map, memory allocation
The old heap maps used a multilevel table, but that
was overkill: there are only 1M entries on a 32-bit
machine and we can arrange to use a dense address
range on a 64-bit machine.
The heap map is in bss. The assumption is that if
we don't touch the pages they won't be mapped in.
Also moved some duplicated memory allocation
code out of the OS-specific files.
Rob Pike [Fri, 28 Jan 2011 18:53:06 +0000 (10:53 -0800)]
gob: updates to the debugging tool.
- complex numbers now supported.
- entirely independent of standard decode code.
- parser has no read-ahead; that is, the scanning works
simply by reading the values as they arrive, not by trying
to count bytes for message boundaries, a proof of concept
for the pending rewrite of the regular decoder.
Robert Griesemer [Thu, 27 Jan 2011 22:11:58 +0000 (14:11 -0800)]
godoc: tiny bug fix - use correct filename when comparing files against the index whitelist
This bug prevented files such as READMEs etc. from being included in the index.
For instance, now author names recorded in the AUTHORS file can be found with
a godoc query.
Gustavo Niemeyer [Thu, 27 Jan 2011 19:09:03 +0000 (14:09 -0500)]
6l: Relocate CMOV* instructions
The linker avoids a GOT indirection by turning a MOV into
a LEA, but with x86-64 GCC has started emitting CMOV*
instructions which break the existing logic.
This will generate errors such as:
unexpected GOT reloc for non-dynamic symbol luaO_nilobject_
The CMOV* instructions may be emitted with normal code like:
if (o >= L->top) return cast(TValue *, luaO_nilobject);
else return o;
Which gets compiled into (relocation offset at 1b):
Robert Griesemer [Tue, 25 Jan 2011 21:32:56 +0000 (13:32 -0800)]
scanner: fix Position returned by Scan, Pos
The implementation of the position computation
was surprisingly broken. Implemented fixes and
added extra test cases.
There is a slight interface change: Calling
Pos() returns the current position; but if
called before Scan() that position may not
be the position of the next token returned
by Scan() (depending on the scan settings
and the source text) - this in contrast to
the original comment.
However, after calling Scan(), the Scanner's
Position field reports the position of the
scanned token, as before.
Gustavo Niemeyer [Tue, 25 Jan 2011 01:36:13 +0000 (11:36 +1000)]
misc: Import/Drop commands for Vim
New ftplugin adds Import and Drop commands for Go buffers
in Vim. These commands ensure that the provided package is
imported (or not imported) in the current Go buffer, using
proper style and ordering, without moving the cursor.
E.g.
:Import strings
:ImportAs . strings
:Drop strings
Two mappings are also introduced to help with the fmt package:
Hector Chu [Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)]
codereview: fix windows
Uploading go files on Windows aborts with gofmt: exceptions.ValueError:
close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr
R=rsc, mattn, Joe Poirier
CC=golang-dev
https://golang.org/cl/4025046
Rob Pike [Sat, 22 Jan 2011 00:10:39 +0000 (16:10 -0800)]
gob: fix the grammar comments to match the encoder
(or at least a correct encoder, still to come).
Change the debug structure slightly to better represent
the grammar.
Minor tweaks for consistency in type.go.
Ian Lance Taylor [Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)]
net: Fix race condition in test.
The test code used to do this:
for _, tc := range tests {
ch <- &tc
}
Note that &tc is always the same value here. As the value is
received from the channel, the sender can loop around and
change the contents of tc. This means that the receiver's
value is unstable and can change while it is in use.