summaryrefslogtreecommitdiff
path: root/src/runtime/cgocallback.go
Commit message (Collapse)AuthorAgeFilesLines
* runtime: fix _cgo_allocate(0)Russ Cox2014-10-071-0/+3
| | | | | | | | | Fixes a SWIG bug reported off-list. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/155990043
* runtime: remove untyped allocation of ParForRuss Cox2014-09-161-1/+1
| | | | | | | | | | | | | | | | Now it's two allocations. I don't see much downside to that, since the two pieces were in different cache lines anyway. Rename 'conservative' to 'cgo_conservative_type' and make clear that _cgo_allocate is the only allowed user. This depends on CL 141490043, which removes the other use of conservative (in defer). LGTM=dvyukov, iant R=khr, dvyukov, iant CC=golang-codereviews, rlh https://codereview.appspot.com/139610043
* runtime: merge mallocgc, gomallocgcRuss Cox2014-09-091-1/+1
| | | | | | | | | | | | | | | | | | | I assumed they were the same when I wrote cgocallback.go earlier today. Merge them to eliminate confusion. I can't tell what gomallocgc did before with a nil type but without FlagNoScan. I created a call like that in cgocallback.go this morning, translating from a C file. It was supposed to do what the C version did, namely treat the block conservatively. Now it will. LGTM=khr R=khr CC=golang-codereviews https://codereview.appspot.com/141810043
* liblink, runtime: diagnose and fix C code running on Go stackRuss Cox2014-09-081-0/+37
This CL contains compiler+runtime changes that detect C code running on Go (not g0, not gsignal) stacks, and it contains corrections for what it detected. The detection works by changing the C prologue to use a different stack guard word in the G than Go prologue does. On the g0 and gsignal stacks, that stack guard word is set to the usual stack guard value. But on ordinary Go stacks, that stack guard word is set to ^0, which will make any stack split check fail. The C prologue then calls morestackc instead of morestack, and morestackc aborts the program with a message about running C code on a Go stack. This check catches all C code running on the Go stack except NOSPLIT code. The NOSPLIT code is allowed, so the check is complete. Since it is a dynamic check, the code must execute to be caught. But unlike the static checks we've been using in cmd/ld, the dynamic check works with function pointers and other indirect calls. For example it caught sigpanic being pushed onto Go stacks in the signal handlers. Fixes issue 8667. LGTM=khr, iant R=golang-codereviews, khr, iant CC=golang-codereviews, r https://codereview.appspot.com/133700043