diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-10-10 16:52:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-10-10 16:52:09 +0000 |
commit | 5d8c099edebfe908256c2bd77a0e2b67182b0f57 (patch) | |
tree | 6033d9fc6d1e3f5c3019c9b13d28e70655697a67 /libgo/runtime/go-cgo.c | |
parent | 40962ac03a869cf7e07e0672c0a649371896277b (diff) | |
download | gcc-5d8c099edebfe908256c2bd77a0e2b67182b0f57.zip gcc-5d8c099edebfe908256c2bd77a0e2b67182b0f57.tar.gz gcc-5d8c099edebfe908256c2bd77a0e2b67182b0f57.tar.bz2 |
runtime: copy channel code from Go 1.7 runtime
Change the compiler to use the new routines. Drop the separation of
small and large values when sending on a channel. Allocate the select
struct on the stack. Remove the old C implementation of channels. Adjust
the garbage collector for the new data structure.
Bring in part of the tracing code, enough for the channel code to call.
Bump the permitted number of allocations in one of the tests in
context_test.go. The difference is that now receiving from a channel
allocates a sudog, which the C code used to simply put on the
stack. This will be somewhat better when we port proc.go.
Reviewed-on: https://go-review.googlesource.com/30714
From-SVN: r240941
Diffstat (limited to 'libgo/runtime/go-cgo.c')
-rw-r--r-- | libgo/runtime/go-cgo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/runtime/go-cgo.c b/libgo/runtime/go-cgo.c index 7d0494c..a7d87a7 100644 --- a/libgo/runtime/go-cgo.c +++ b/libgo/runtime/go-cgo.c @@ -10,7 +10,8 @@ #include "go-panic.h" #include "go-type.h" -extern void __go_receive (ChanType *, Hchan *, byte *); +extern void chanrecv1 (ChanType *, Hchan *, void *) + __asm__ (GOSYM_PREFIX "runtime.chanrecv1"); /* Prepare to call from code written in Go to code written in C or C++. This takes the current goroutine out of the Go scheduler, as @@ -97,7 +98,7 @@ syscall_cgocallback () Go. In the case of -buildmode=c-archive or c-shared, this call may be coming in before package initialization is complete. Wait until it is. */ - __go_receive (NULL, runtime_main_init_done, NULL); + chanrecv1 (NULL, runtime_main_init_done, NULL); } mp = runtime_m (); |