Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCallback ¶
func NewCallback(fn interface{}) uintptr
NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. This is useful when interoperating with Windows code requiring callbacks. The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr. Only a limited number of callbacks may be created in a single Go process, and any memory allocated for these callbacks is never released. Between NewCallback and NewCallbackCDecl, at least 1024 callbacks can always be created. Although this function is similiar to the darwin version it may act differently.
func SyscallN ¶
SyscallN takes fn, a C function pointer and a list of arguments as uintptr. There is an internal maximum number of arguments that SyscallN can take. It panics when the maximum is exceeded. It returns the result and the libc error code if there is one.
NOTE: SyscallN does not properly call functions that have both integer and float parameters. See discussion comment https://github.com/ebiten/purego/pull/1#issuecomment-1128057607 for an explanation of why that is.
On amd64, if there are more than 8 floats the 9th and so on will be placed incorrectly on the stack.
The pragma go:nosplit is not needed at this function declaration because it uses go:uintptrescapes which forces all the objects that the uintptrs point to onto the heap where a stack split won't affect their memory location.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
fakecgo
Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go.
|
Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go. |
Package objc is a low-level pure Go objective-c runtime.
|
Package objc is a low-level pure Go objective-c runtime. |