-
- Downloads
runtime: fixes for -buildmode=c-archive
With -buildmode=c-archive, initsig is called before the memory allocator has been initialized. The code was doing a memory allocation because of the call to funcPC(sigtramp). When escape analysis is fully implemented, that call should not allocate. For now, finesse the issue by calling a C function to get the C function pointer value of sigtramp. When returning from a call from C to a Go function, a deferred function is run to go back to syscall mode. When the call occurs on a non-Go thread, that call sets g to nil, making it impossible to add the _defer struct back to the pool. Just drop it and let the garbage collector clean it up. Reviewed-on: https://go-review.googlesource.com/33675 From-SVN: r242992
Showing
- gcc/go/gofrontend/MERGE 1 addition, 1 deletiongcc/go/gofrontend/MERGE
- libgo/go/runtime/panic.go 9 additions, 0 deletionslibgo/go/runtime/panic.go
- libgo/go/runtime/signal1_unix.go 3 additions, 3 deletionslibgo/go/runtime/signal1_unix.go
- libgo/go/runtime/stubs.go 2 additions, 2 deletionslibgo/go/runtime/stubs.go
- libgo/runtime/go-signal.c 9 additions, 0 deletionslibgo/runtime/go-signal.c
Loading
Please register or sign in to comment