runtime

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Compiler = "tinygo"
View Source
const GOARCH = "amd64"
View Source
const GOOS = "linux"
View Source
const TargetBits = 64

The bitness of the CPU (e.g. 8, 32, 64).

Variables

This section is empty.

Functions

func Breakpoint added in v0.31.0

func Breakpoint()

Stub for Breakpoint, does not do anything.

func Caller

func Caller(skip int) (pc uintptr, file string, line int, ok bool)

func Callers added in v0.19.0

func Callers(skip int, pc []uintptr) int

func GOMAXPROCS

func GOMAXPROCS(n int) int

func GOROOT

func GOROOT() string

func Goexit added in v0.9.0

func Goexit()

Goexit terminates the currently running goroutine. No other goroutines are affected.

Unlike the main Go implementation, no deffered calls will be run.

func Gosched added in v0.9.0

func Gosched()

func KeepAlive added in v0.27.0

func KeepAlive(x interface{})

KeepAlive makes sure the value in the interface is alive until at least the point of the call.

func LockOSThread added in v0.23.0

func LockOSThread()

LockOSThread wires the calling goroutine to its current operating system thread. Stub for now Called by go1.18 standard library on windows, see https://github.com/golang/go/issues/49320

func NumCPU added in v0.23.0

func NumCPU() int

NumCPU returns the number of logical CPUs usable by the current process.

The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup are not reflected.

func NumCgoCall added in v0.23.0

func NumCgoCall() int

Stub for NumCgoCall, does not return the real value

func NumGoroutine added in v0.23.0

func NumGoroutine() int

Stub for NumGoroutine, does not return the real value

func Stack added in v0.14.0

func Stack(buf []byte, all bool) int

func UnlockOSThread added in v0.23.0

func UnlockOSThread()

UnlockOSThread undoes an earlier call to LockOSThread. Stub for now

func Version added in v0.23.0

func Version() string

Version returns the Tinygo tree's version string. It is the same as goenv.Version().

Types

type Cond added in v0.17.0

type Cond struct {
	// contains filtered or unexported fields
}

Cond is a simplified condition variable, useful for notifying goroutines of interrupts.

func (*Cond) Notify added in v0.17.0

func (c *Cond) Notify() bool

Notify sends a notification. If the condition variable already has a pending notification, this returns false.

func (*Cond) Poll added in v0.17.0

func (c *Cond) Poll() bool

Poll checks for a notification. If a notification is found, it is cleared and this returns true.

func (*Cond) Wait added in v0.17.0

func (c *Cond) Wait()

Wait for a notification. If the condition variable was previously notified, this returns immediately.

type Error added in v0.14.0

type Error interface {
	error

	RuntimeError()
}

The Error interface identifies a run time error.

type Frame added in v0.19.0

type Frame struct {
	PC uintptr

	Func *Func

	Function string

	File string
	Line int

	Entry uintptr
}

type Frames added in v0.19.0

type Frames struct {
}

func CallersFrames added in v0.19.0

func CallersFrames(callers []uintptr) *Frames

func (*Frames) Next added in v0.19.0

func (ci *Frames) Next() (frame Frame, more bool)

type Func

type Func struct {
}

func FuncForPC

func FuncForPC(pc uintptr) *Func

func (*Func) FileLine added in v0.22.0

func (f *Func) FileLine(pc uintptr) (file string, line int)

func (*Func) Name

func (f *Func) Name() string

type MemStats added in v0.26.0

type MemStats struct {

	// Sys is the total bytes of memory obtained from the OS.
	//
	// Sys is the sum of the XSys fields below. Sys measures the
	// address space reserved by the runtime for the
	// heap, stacks, and other internal data structures.
	Sys uint64

	// HeapSys is bytes of heap memory, total.
	//
	// In TinyGo unlike upstream Go, we make no distinction between
	// regular heap blocks used by escaped-to-the-heap variables and
	// blocks occupied by goroutine stacks,
	// all such blocks are marked as in-use, see HeapInuse below.
	HeapSys uint64

	// HeapIdle is bytes in idle (unused) blocks.
	HeapIdle uint64

	// HeapInuse is bytes in in-use blocks.
	HeapInuse uint64

	// HeapReleased is bytes of physical memory returned to the OS.
	HeapReleased uint64

	// TotalAlloc is cumulative bytes allocated for heap objects.
	//
	// TotalAlloc increases as heap objects are allocated, but
	// unlike Alloc and HeapAlloc, it does not decrease when
	// objects are freed.
	TotalAlloc uint64

	// Mallocs is the cumulative count of heap objects allocated.
	// The number of live objects is Mallocs - Frees.
	Mallocs uint64

	// Frees is the cumulative count of heap objects freed.
	Frees uint64

	// GCSys is bytes of memory in garbage collection metadata.
	GCSys uint64
}

A MemStats records statistics about the memory allocator.

Directories

Path Synopsis
Package debug is a dummy package that is not yet implemented.
Package debug is a dummy package that is not yet implemented.
internal
sys
Package interrupt provides access to hardware interrupts.
Package interrupt provides access to hardware interrupts.
Stubs for the runtime/trace package
Stubs for the runtime/trace package
Package volatile provides definitions for volatile loads and stores.
Package volatile provides definitions for volatile loads and stores.

Jump to

Keyboard shortcuts

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