summaryrefslogtreecommitdiff
path: root/misc/cgo/test/callback.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-16 11:03:11 -0400
committerRuss Cox <rsc@golang.org>2014-09-16 11:03:11 -0400
commitb9600256a044061cd2d410a352bd821bc84e4754 (patch)
tree13209e3524d6198405e9237aedcb6ae7dd6f70f6 /misc/cgo/test/callback.go
parentc9afff3fcecc335ae25cef3ec5f4040fb30e2f9a (diff)
downloadgo-b9600256a044061cd2d410a352bd821bc84e4754.tar.gz
runtime: remove untyped allocation of ParFor
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
Diffstat (limited to 'misc/cgo/test/callback.go')
-rw-r--r--misc/cgo/test/callback.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/cgo/test/callback.go b/misc/cgo/test/callback.go
index 281e79494..a7f1a3ecd 100644
--- a/misc/cgo/test/callback.go
+++ b/misc/cgo/test/callback.go
@@ -9,6 +9,7 @@ void callback(void *f);
void callGoFoo(void);
void callGoStackCheck(void);
void callPanic(void);
+void callCgoAllocate(void);
*/
import "C"
@@ -207,6 +208,10 @@ func testPanicFromC(t *testing.T) {
C.callPanic()
}
+func testAllocateFromC(t *testing.T) {
+ C.callCgoAllocate() // crashes or exits on failure
+}
+
func testCallbackStack(t *testing.T) {
// Make cgo call and callback with different amount of stack stack available.
// We do not do any explicit checks, just ensure that it does not crash.