Help us shape the future of Go! Take the 2026 Go Developer Survey

arch

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry struct {
	Caller     FunctionCaller
	Classifier ArgumentClassifier
}

Registry contains registered implementations.

Functions

func Register

func Register(caller FunctionCaller, classifier ArgumentClassifier)

Register registers implementations for the current architecture.

Types

type ArgumentClassification

type ArgumentClassification struct {
	GPRCount int
	SSECount int
}

ArgumentClassification contains argument passing information.

type ArgumentClassifier

type ArgumentClassifier interface {
	ClassifyReturn(t *types.TypeDescriptor, abi types.CallingConvention) int
	ClassifyArgument(t *types.TypeDescriptor, abi types.CallingConvention) ArgumentClassification
}

ArgumentClassifier defines the contract for argument classification.

type FunctionCaller

type FunctionCaller interface {
	Execute(cif *types.CallInterface, fn unsafe.Pointer, rvalue unsafe.Pointer, avalue []unsafe.Pointer, errnoFn uintptr) (cerrno uintptr, err error)
}

FunctionCaller defines the contract for function execution. Execute always captures C errno inside the assembly trampoline immediately after the C function returns. On platforms without errno support (Windows), errnoFn is 0 and the returned cerrno is always 0.

type StackLayout added in v0.6.6

type StackLayout interface {
	StackArgBytes(cif *types.CallInterface) (need, limit uintptr, err error)
}

StackLayout is implemented by architectures whose call path computes the exact stack space a call needs. PrepareCallInterface uses it instead of the generic register/slot count, which assumes amd64's limits.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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