Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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.