package pkginit
import "cmd/compile/internal/pkginit"
Index ¶
- Constants
- Variables
- func GetRedzoneSizeForGlobal(size int64) int64
- func MakeInit()
- func Task() *ir.Name
- type InitOrder
Constants ¶
const ( InitNotStarted = iota InitDone InitPending )
Static initialization phase. These values are stored in two bits in Node.flags.
Variables ¶
InstrumentGlobalsMap contains only package-local (and unlinknamed from somewhere else) globals. And the key is the object name. For example, in package p, a global foo would be in this map as "foo". Consider range over maps is nondeterministic, make a slice to hold all the values in the InstrumentGlobalsMap and iterate over the InstrumentGlobalsSlice.
Functions ¶
func GetRedzoneSizeForGlobal ¶
Calculate redzone for globals.
func MakeInit ¶
func MakeInit()
MakeInit creates a synthetic init function to handle any package-scope initialization statements.
TODO(mdempsky): Move into noder, so that the types2-based frontends can use Info.InitOrder instead.
func Task ¶
Task makes and returns an initialization record for the package. See runtime/proc.go:initTask for its layout. The 3 tasks for initialization are:
- Initialize all of the packages the current package depends on.
- Initialize all the variables that have initializers.
- Run any init functions.
Types ¶
type InitOrder ¶
type InitOrder struct {
// contains filtered or unexported fields
}
Source Files ¶
init.go initAsanGlobals.go initorder.go
- Version
- v1.21.5
- Published
- Nov 29, 2023
- Platform
- js/wasm
- Imports
- 15 packages
- Last checked
- 2 minutes ago –
Tools for package owners.