mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: reimplement GODEBUG=cgocheck=2 as a GOEXPERIMENT
Move this knob from a binary-startup thing to a build-time thing. This will enable followon optmizations to the write barrier. Change-Id: Ic3323348621c76a7dc390c09ff55016b19c43018 Reviewed-on: https://go-review.googlesource.com/c/go/+/447778 Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
44d22e75dd
commit
55044288ad
18 changed files with 168 additions and 90 deletions
|
|
@ -751,17 +751,6 @@ func schedinit() {
|
|||
// World is effectively started now, as P's can run.
|
||||
worldStarted()
|
||||
|
||||
// For cgocheck > 1, we turn on the write barrier at all times
|
||||
// and check all pointer writes. We can't do this until after
|
||||
// procresize because the write barrier needs a P.
|
||||
if debug.cgocheck > 1 {
|
||||
writeBarrier.cgo = true
|
||||
writeBarrier.enabled = true
|
||||
for _, pp := range allp {
|
||||
pp.wbBuf.reset()
|
||||
}
|
||||
}
|
||||
|
||||
if buildVersion == "" {
|
||||
// Condition should never trigger. This code just serves
|
||||
// to ensure runtime·buildVersion is kept in the resulting binary.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue