We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cab016 commit 59fc42bCopy full SHA for 59fc42b
src/runtime/cgocall.go
@@ -113,11 +113,6 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
113
mp.ncgo++
114
defer endcgo(mp)
115
116
- // Allocate memory to hold a cgo traceback if the cgo call crashes.
117
- if mp.cgoCallers == nil {
118
- mp.cgoCallers = new(cgoCallers)
119
- }
120
-
121
// Reset traceback.
122
mp.cgoCallers[0] = 0
123
src/runtime/proc.go
@@ -510,6 +510,11 @@ func mcommoninit(mp *m) {
510
// so we need to publish it safely.
511
atomicstorep(unsafe.Pointer(&allm), unsafe.Pointer(mp))
512
unlock(&sched.lock)
513
+
514
+ // Allocate memory to hold a cgo traceback if the cgo call crashes.
515
+ if iscgo || GOOS == "solaris" || GOOS == "windows" {
516
+ mp.cgoCallers = new(cgoCallers)
517
+ }
518
}
519
520
// Mark gp ready to run.
0 commit comments