X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/base
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
base
/
📁
..
📄
base.go
(2.04 KB)
📄
bootstrap_false.go
(377 B)
📄
bootstrap_true.go
(374 B)
📄
debug.go
(3.25 KB)
📄
flag.go
(16.4 KB)
📄
link.go
(1.08 KB)
📄
mapfile_mmap.go
(1.28 KB)
📄
mapfile_read.go
(565 B)
📄
print.go
(8.33 KB)
📄
timings.go
(5.77 KB)
Editing: base.go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package base import ( "os" ) var atExitFuncs []func() func AtExit(f func()) { atExitFuncs = append(atExitFuncs, f) } func Exit(code int) { for i := len(atExitFuncs) - 1; i >= 0; i-- { f := atExitFuncs[i] atExitFuncs = atExitFuncs[:i] f() } os.Exit(code) } // To enable tracing support (-t flag), set EnableTrace to true. const EnableTrace = false func Compiling(pkgs []string) bool { if Ctxt.Pkgpath != "" { for _, p := range pkgs { if Ctxt.Pkgpath == p { return true } } } return false } // The racewalk pass is currently handled in three parts. // // First, for flag_race, it inserts calls to racefuncenter and // racefuncexit at the start and end (respectively) of each // function. This is handled below. // // Second, during buildssa, it inserts appropriate instrumentation // calls immediately before each memory load or store. This is handled // by the (*state).instrument method in ssa.go, so here we just set // the Func.InstrumentBody flag as needed. For background on why this // is done during SSA construction rather than a separate SSA pass, // see issue #19054. // // Third we remove calls to racefuncenter and racefuncexit, for leaf // functions without instrumented operations. This is done as part of // ssa opt pass via special rule. // TODO(dvyukov): do not instrument initialization as writes: // a := make([]int, 10) // Do not instrument the following packages at all, // at best instrumentation would cause infinite recursion. var NoInstrumentPkgs = []string{ "runtime/internal/atomic", "runtime/internal/math", "runtime/internal/sys", "runtime/internal/syscall", "runtime", "runtime/race", "runtime/msan", "runtime/asan", "internal/cpu", } // Don't insert racefuncenter/racefuncexit into the following packages. // Memory accesses in the packages are either uninteresting or will cause false positives. var NoRacePkgs = []string{"sync", "sync/atomic"}
Upload File
Create Folder