- mkall now generates syscall stabs automatically
- we can call unicode versions of winapi now
- introduce GetErrstr function to fetch error text given errno
- general cleanup
R=rsc
CC=golang-dev
https://golang.org/cl/562041
This keeps fragmentation from delaying
garbage collections (and causing more fragmentation).
Cuts fresh godoc (with indexes) from 261M to 166M (120M live).
Cuts toy wc program from 50M to 8M.
Fixes#647.
R=r, cw
CC=golang-dev
https://golang.org/cl/257041
because free needs to mark the block as freed to
coordinate with the garbage collector.
(in C++ free can blindly put the block on the free list,
no questions asked, so the cache saves some work.)
R=iant
CC=golang-dev
https://golang.org/cl/206069
* specialize sweepspan as sweepspan0 and sweepspan1.
* in sweepspan1, inline "free" to avoid expensive mlookup.
R=iant
CC=golang-dev
https://golang.org/cl/206060
bonus: type switch now detects multiple uses of identical interface types.
bonus: interface types are now order-independent, following the spec.
R=ken2
CC=golang-dev
https://golang.org/cl/194053
need better management of mach semaphores eventually
but this avoids allocating them for uncontended Locks.
R=r
CC=agl1, golang-dev
https://golang.org/cl/190079
* move memory code into $GOOS-specific directory.
* allow printing of static strings < 256 bytes.
(dynamic strings will bump maxstring as they are allocated.)
* use cgo2c for runtime.mal.
R=r, dho
CC=golang-dev
https://golang.org/cl/186143
(Thanks to ken and rsc for pointing this out)
rsc:
ken pointed out that there's a race in the new
one-lock-per-channel code. the issue is that
if one goroutine has gone to sleep doing
select {
case <-c1:
case <-c2:
}
and then two more goroutines try to send
on c1 and c2 simultaneously, the way that
the code makes sure only one wins is the
selgen field manipulation in dequeue:
// if sgp is stale, ignore it
if(sgp->selgen != sgp->g->selgen) {
//prints("INVALID PSEUDOG POINTER\n");
freesg(c, sgp);
goto loop;
}
// invalidate any others
sgp->g->selgen++;
but because the global lock is gone both
goroutines will be fiddling with sgp->g->selgen
at the same time.
This results in a 7% slowdown in the single threaded case for a
ping-pong microbenchmark.
Since the cas predominantly succeeds, adding a simple check first
didn't make any difference.
R=rsc
CC=golang-dev
https://golang.org/cl/180068
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
4th set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180049
This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.
R=rsc
CC=golang-dev
https://golang.org/cl/171044
FreeBSD was passing stk as the new thread's stack base, while
stk is the top of the stack in go. The added check should cause
a trap if this ever comes up in any new ports, or regresses
in current ones.
R=rsc
CC=golang-dev
https://golang.org/cl/167055
On a microbenchmark that ping-pongs on lots of channels, this makes
the multithreaded case about 20% faster and the uniprocessor case
about 1% slower. (Due to cache effects, I expect.)
R=rsc, agl
CC=golang-dev
https://golang.org/cl/166043
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes#115.
R=rsc, dsymonds1
https://golang.org/cl/157067
* add runtime sliceslice1 for x[lo:]
* remove runtime arraytoslice, rewriting &arr into arr[0:len(arr)].
* port cgen_inline into 8g, 5g.
* use native memmove in maps
R=ken2
https://golang.org/cl/157106
In thread.c, we need to cast to whatever the native
size of intptr is on the system, but we only have
uintptr available. They're the same size, but can't
do signed casts without this one :).
R=rsc
CC=golang-dev
https://golang.org/cl/156073
* move memmove to arch-specific subdirectories
* add memmove for arm
* add copyright notices marking them as copied from Inferno
R=ken2
https://golang.org/cl/156061
the signal handling stack is a different size than
the normal stack, so it cannot be allocated using
the backup stack allocator.
Fixes#250.
R=agl1
CC=golang-dev
https://golang.org/cl/157044
cgo/libmach remain unimplemented. However, compilers, runtime,
and packages are 100%. I still need to go through and implement
missing syscalls (at least make sure they're all listed), but
for all shipped functionality, this is done. Ship! ;)
R=rsc, VenkateshSrinivas
https://golang.org/cl/152142
SELinux will cause mmap to fail when we request w+x memory unless the
user has configured their policies. We have a warning in make.bash,
but it's quite likely that the policy will be reset at some point and
then all their binaries start failing.
This patch prints a warning on Linux when mmap fails with EACCES.
R=rsc
CC=golang-dev
https://golang.org/cl/152086
selfree maintains a cache of Select structures for several sizes. In
newselect, we'll use an entry from the cache if one is found. However,
the Scase structures corresponding to a send may have been allocated
for the wrong size. In this case we'll write off the end of the Scase
into random memory and, generally, read some amount of junk in the
receive.
This patch fixes the issue by removing the cache, on the advice of
rsc.
R=rsc
CC=go-dev
http://go/go-review/1016002
when switching architectures.
fix bug twice: make sure clean removes the file,
and generate into architecture-specific file names.
R=r
http://go/go-review/1013018
call. This uses the header files from a 32-bit Ubuntu Hardy
system.
The use of _LOOSE_KERNEL_NAMES seems right. The
-D__ARCH_SI_UID_T works around a bug which appears to be fixed
in later Linux versions.
R=rsc
http://go/go-review/1013015
now that all arguments are passed on the stack.
go/test: passes 89% (310/345)
R=rsc
APPROVED=rsc
DELTA=33 (13 added, 14 deleted, 6 changed)
OCL=36009
CL=36022
because they are in package runtime.
another step to enforcing package boundaries.
R=r
DELTA=732 (114 added, 93 deleted, 525 changed)
OCL=35811
CL=35824
5g. fixes to 64 bit code gen. added (finally) function to do
shifts properly.
go/test: passes 83% (287/342)
R=rsc
APPROVED=rsc
DELTA=156 (50 added, 53 deleted, 53 changed)
OCL=35589
CL=35616
* in 6l, -K already meant check for stack underflow.
add -KK to mean double-check stack overflows
even in nosplit functions.
* comment out print locks; they deadlock too easily
but are still useful to put back for special occasions.
* let runcgo assembly switch to scheduler stack
without involving scheduler directly. because runcgo
gets called from matchmg, it is too hard to keep it
from being called on other stacks.
R=r
DELTA=94 (65 added, 18 deleted, 11 changed)
OCL=35591
CL=35604
better mach binaries.
cgo working on darwin+linux amd64+386.
eliminated context switches - pi is 30x faster.
add libcgo to build.
on snow leopard:
- non-cgo binaries work; all tests pass.
- cgo binaries work on amd64 but not 386.
R=r
DELTA=2031 (1316 added, 626 deleted, 89 changed)
OCL=35264
CL=35304
* change ldt0setup to set GS itself; nacl won't let us do it.
* change breakpoint to INT $3 so 8l can translate to HLT for nacl.
* panic if closure is needed on nacl.
* do not try to access symbol table on nacl.
* mmap in 64kB chunks.
nacl support:
* system calls, threading, locks.
R=r
DELTA=365 (357 added, 5 deleted, 3 changed)
OCL=34880
CL=34906
params. a number of fixes to assembly routines that assumed R0
had the first arg. one stack offset fix, arm pushes the link
register on stack top.
go/test: passes 65% (235/364) tests
R=rsc
APPROVED=rsc
DELTA=20 (11 added, 0 deleted, 9 changed)
OCL=34809
CL=34812