summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
AgeCommit message (Collapse)AuthorFilesLines
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-2/+2
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-17/+97
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-189/+189
2010-06-28Only catch all signals if os/signal package imported.Ian Lance Taylor1-1/+1
Fixes issue 776. R=rsc CC=golang-dev http://codereview.appspot.com/1745041
2010-05-19runtime: avoid allocation for fixed stringsRuss Cox1-0/+1
R=r CC=golang-dev http://codereview.appspot.com/1083041
2010-05-06runtime.GOMAXPROCS: hack it to have it return the old value.Rob Pike1-0/+1
R=rsc CC=golang-dev http://codereview.appspot.com/1140041
2010-05-01gc: be pickier about slice, chan, array, and map sizesRuss Cox1-2/+2
Fixes issue 589. R=ken2 CC=golang-dev http://codereview.appspot.com/1032044
2010-04-29rename GOOS=mingw to GOOS=windowsAlex Brainman1-2/+2
R=rsc, Joe Poirier CC=golang-dev http://codereview.appspot.com/1015043 Committer: Russ Cox <rsc@golang.org>
2010-04-15support for printing floats:Kai Backman1-0/+1
fmt.Printf("float32 %f\n", float32(1234.56789)) fmt.Printf("float64 %f\n", float64(1234.56789)) -> float32 1234.567871 float64 1234.567890 this is a snapshot. extended instruction support, corner cases and fixes coming in subseuent cls. R=rsc CC=dpx, golang-dev http://codereview.appspot.com/876045
2010-04-09runtime: delete malx, skip_depth argument to mallocRuss Cox1-1/+0
remove internal functions from traces in gopprof instead. R=r CC=golang-dev http://codereview.appspot.com/855046
2010-04-09Library support for cgo export.Ian Lance Taylor1-2/+3
These functions are used to call from a C function back to a Go function. This only includes 386 support. R=rsc CC=golang-dev http://codereview.appspot.com/834045
2010-04-08runtime: turn divide by zero, nil dereference into panicsRuss Cox1-0/+4
tested on linux/amd64, linux/386, linux/arm, darwin/amd64, darwin/386. freebsd untested; will finish in a separate CL. for now all the panics are errorStrings. richer structures can be added as necessary once the mechanism is shaked out. R=r CC=golang-dev http://codereview.appspot.com/906041
2010-04-08runtime: fix bad status throwRuss Cox1-0/+4
when garbage collector sees recovering goroutine Fixes issue 711. R=r CC=golang-dev http://codereview.appspot.com/869045
2010-04-05runtime: handle malloc > 2GB correctlyRuss Cox1-1/+1
R=ken2 CC=golang-dev http://codereview.appspot.com/821048
2010-04-05runtime: various arm fixesRuss Cox1-1/+1
* correct symbol table size * do not reorder functions in output * traceback * signal handling * use same code for go + defer * handle leaf functions in symbol table R=kaib, dpx CC=golang-dev http://codereview.appspot.com/884041
2010-04-01runtime: turn run time errors checks into panicsRuss Cox1-2/+6
R=ken2, r CC=golang-dev http://codereview.appspot.com/871042 Committer: Russ Cox <rsc@golang.org>
2010-03-31runtime: make type assertion a runtime.Error, the first of manyRuss Cox1-3/+9
R=r CC=golang-dev http://codereview.appspot.com/805043
2010-03-31gc: implement panic and recoverRuss Cox1-1/+19
R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/831042
2010-03-30gc: add panic and recover (still unimplemented in runtime)Russ Cox1-1/+3
main semantic change is to enforce single argument to panic. runtime: change to 1-argument panic. use String method on argument if it has one. R=ken2, r CC=golang-dev http://codereview.appspot.com/812043
2010-03-29runtime: run deferred calls at GoexitRuss Cox1-0/+1
baby step toward panic+recover. Fixes issue 349. R=r CC=golang-dev http://codereview.appspot.com/825043
2010-03-26runtime: run all finalizers in a single goroutine.Russ Cox1-1/+4
eliminate second pass of mark+sweep by scanning finalizer table specially. R=r CC=golang-dev http://codereview.appspot.com/782041
2010-03-24runtime: malloc sampling, pprof interfaceRuss Cox1-7/+6
R=r CC=golang-dev http://codereview.appspot.com/719041
2010-03-23runtime: add memory profiling, disabled.Russ Cox1-1/+2
no way to get the data out yet. add prototype for runtime.Callers, missing from last CL. R=r CC=golang-dev http://codereview.appspot.com/713041
2010-03-23runtime: add CallersRuss Cox1-0/+1
cut copies of traceback from 6 to 1. R=r CC=golang-dev http://codereview.appspot.com/703041
2010-02-19fixed bug in mpconst float multiply by 0.Ken Thompson1-1/+15
more complex -- constants, variables and print. R=rsc CC=golang-dev http://codereview.appspot.com/217061
2010-02-08runtime: allow arbitrary return type in SetFinalizer.Russ Cox1-1/+3
finalize chan, to free OS X semaphore inside Lock. os: finalize File, to close fd. Fixes issue 503. R=ken2 CC=golang-dev http://codereview.appspot.com/204065
2010-02-08runtime: instrument malloc + garbage collector.Russ Cox1-0/+2
add simple garbage collection benchmark. R=iant CC=golang-dev http://codereview.appspot.com/204053
2010-02-06fix commentKai Backman1-1/+1
R=rsc CC=golang-dev http://codereview.appspot.com/203053
2010-02-03finalizers; merge package malloc into package runtimeRuss Cox1-0/+1
R=r, cw CC=golang-dev http://codereview.appspot.com/198085
2010-01-27gc: implement defer print/println/panic/paniclnRuss Cox1-0/+1
Fixes issue 219. R=ken2, r CC=golang-dev http://codereview.appspot.com/194097
2010-01-25in C and asm, replace pkg·name with ·nameRuss Cox1-18/+18
(eliminate assumption of package global name space, make code easier to move between packages). R=r CC=golang-dev http://codereview.appspot.com/194072
2010-01-09runtime: check for preemption due to garbage collectionRuss Cox1-0/+1
in various already expensive routines. helps keep cpu utilization up when GOMAXPROCS > 1, but not a full solution. http://groups.google.com/group/golang-nuts/t/7a9535c4136d3e2 R=r CC=golang-dev http://codereview.appspot.com/184043
2010-01-06Ported runtime to Windows.Hector Chu1-0/+13
R=rsc CC=golang-dev http://codereview.appspot.com/176066 Committer: Russ Cox <rsc@golang.org>
2009-12-18runtime: fix race conditionAdam Langley1-1/+1
(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 http://codereview.appspot.com/180068
2009-12-16runtime: if os/signal is not in use, crash onRuss Cox1-3/+3
most signals, so that ordinary programs can be killed, for example. Fixes issue 434. R=dsymonds1 CC=golang-dev, hoisie http://codereview.appspot.com/180064
2009-12-15os/signal: new packageDavid Symonds1-0/+7
Fixes issue 71. R=rsc, r http://codereview.appspot.com/162056 Committer: Russ Cox <rsc@golang.org>
2009-12-03runtime: malloc fixesRuss Cox1-9/+0
* throw away dead code * add mlookup counter * add malloc counter * set up for blocks with no pointers Fixes issue 367. R=r http://codereview.appspot.com/165050
2009-11-20x[lo:] - gc and runtime.Russ Cox1-1/+1
* 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 http://codereview.appspot.com/157106
2009-11-18Add an intptr type to runtime; needed in FreeBSDDevon H. O'Dell1-0/+2
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 http://codereview.appspot.com/156073 Committer: Russ Cox <rsc@golang.org>
2009-11-13runtime: warn about SELinux based mmap failures on Linux.Adam Langley1-0/+7
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 http://codereview.appspot.com/152086
2009-10-23fix off by 4 bug in morestack (lr again). remove storing of r0Kai Backman1-1/+0
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
2009-10-15rename sys functions to runtime,Russ Cox1-31/+31
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
2009-10-14excise some internal references.Russ Cox1-2/+1
R=r DELTA=209 (65 added, 114 deleted, 30 changed) OCL=35718 CL=35721
2009-10-13write stack traces and panics to stderrRob Pike1-1/+3
R=rsc DELTA=31 (5 added, 3 deleted, 23 changed) OCL=35700 CL=35700
2009-10-12stack overflow debugging and fix.Russ Cox1-1/+0
* 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
2009-10-09keep a list of all the M's,Russ Cox1-0/+2
so that the garbage collector doesn't free them. R=ken OCL=35538 CL=35538
2009-10-038c, 8l dynamic loading support.Russ Cox1-3/+7
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
2009-09-22changes to accommodate nacl:Russ Cox1-0/+1
* 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
2009-09-08pass Type* to makechan and makemap so thatRuss Cox1-2/+2
they can get the official alignment out of there instead of guessing. R=ken OCL=34450 CL=34450
2009-08-26finish ChanValue: Len and Cap.Russ Cox1-0/+2
R=r DELTA=45 (45 added, 0 deleted, 0 changed) OCL=33873 CL=33881