cgo

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blocking

func Blocking(fn *byte, arg0, arg1 uintptr)

func BlockingNoop

func BlockingNoop()

BlockingNoop can be used for benchmarking CGO Trampoline overhead. The C function is empty and returns void.

func BlockingSleep

func BlockingSleep(nanos time.Duration)

BlockingSleep invokes C++ std::thread sleep utilizing the safe CGO trampoline. It is preferable to use time.Sleep in likely all circumstances.

func CGONoop

func CGONoop()

CGONoop can be used for benchmarking CGO overhead. The C function is empty and returns void.

func NonBlocking

func NonBlocking(fn *byte, arg0, arg1 uintptr)

NonBlocking C function fn without going all the way through cgo Be very careful using it. If the C code blocks it can/will lock up your app. Example: NonBlocking((*byte)(C.my_c_func), 0, 0)

void my_c_func(size_t arg0, size_t arg1) {
}

func NonBlockingNoop

func NonBlockingNoop()

NonBlockingNoop can be used for benchmarking Assembly Trampoline/CGO trampoline overhead. The C function is empty and returns void.

func NonBlockingSleep

func NonBlockingSleep(nanos time.Duration)

NonBlockingSleep invokes C++ std::thread sleep using Assembly Trampoline. It is only acceptable to do this after runtime.LockOSThread() and only used when absolutely certain.

WARNING!!! You should probably never use this

Types

This section is empty.

Directories

Path Synopsis
internal
cmd command

Jump to

Keyboard shortcuts

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