layout

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package layout plans the internal storage layout for one package's local variables. It is intentionally independent of LLGo SSA, LLVM, the runtime, and the build cache so every integration layer consumes the same policy result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockCacheName

func BlockCacheName(path string) string

BlockCacheName returns the package block's owner-local direct-cache symbol.

func BlockName

func BlockName(path string) string

BlockName returns the shared package-block accessor symbol.

func EnsureName

func EnsureName(path string, kind locality.Kind) string

EnsureName returns the package/kind first-use initializer symbol.

func FailureCacheName

func FailureCacheName(path string, kind locality.Kind) string

FailureCacheName returns the package/kind initializer failure-cache symbol.

func GoroutineBlockKeyName added in v1.0.4

func GoroutineBlockKeyName(path string) string

GoroutineBlockKeyName returns the process-global identity for that block.

func GoroutineBlockName added in v1.0.4

func GoroutineBlockName(path string) string

GoroutineBlockName returns the logical-G package-block accessor symbol used by schedulers that multiplex goroutines on physical threads.

func GuardName

func GuardName(path string, kind locality.Kind) string

GuardName returns the package/kind native TLS state symbol.

func InitName

func InitName(path string, kind locality.Kind) string

InitName returns the package/kind initializer dispatcher symbol.

Types

type Declaration

type Declaration struct {
	Name string
	Type types.Type
	Info locality.Info
}

Declaration is the source information needed to plan one variable.

type Initializer

type Initializer struct {
	Name  string
	Order int
}

Initializer identifies one replay helper in Go package initialization order.

type Package

type Package struct {
	Path      string
	Variables []Variable
	Block     []Variable
	Thread    []Initializer
	Goroutine []Initializer
	// contains filtered or unexported fields
}

Package is a deterministic storage plan. Block contains all pointer-bearing TLS and GLS variables in their shared physical package block.

func Plan

func Plan(path string, declarations []Declaration) (Package, error)

Plan creates a deterministic package layout. TLS and GLS remain logically distinct, while the current one-thread-per-goroutine backend may share their pointer-bearing package block.

func (Package) Initializers

func (p Package) Initializers(kind locality.Kind) []Initializer

Initializers returns the ordered replay helpers for kind.

func (Package) Lookup

func (p Package) Lookup(name string) (Variable, bool)

Lookup returns a variable from the package plan.

type Storage

type Storage uint8

Storage identifies the physical addressing strategy selected for a variable.

const (
	StorageUnknown Storage = iota
	StorageNativeTLS
	StoragePackage
)

func StorageForType

func StorageForType(typ types.Type) Storage

StorageForType returns the physical storage class for a local variable type. Pointer-free values use native LLVM TLS; values visible to the GC share the package block rooted by LocalContext.

type Variable

type Variable struct {
	Declaration
	Storage Storage
	Field   int
}

Variable is one planned local variable. Field is valid for package storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL