runtime

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocU added in v0.5.0

func AllocU(size uintptr) unsafe.Pointer

AllocU allocates uninitialized memory.

func AllocZ added in v0.5.0

func AllocZ(size uintptr) unsafe.Pointer

AllocZ allocates zero-initialized memory.

func AssertIndexRange added in v0.8.3

func AssertIndexRange(b bool)

func AssertNegativeShift added in v0.8.3

func AssertNegativeShift(b bool)

func AssertRuntimeError added in v0.8.3

func AssertRuntimeError(b bool, msg string)

func CStrCopy added in v0.4.0

func CStrCopy(dest unsafe.Pointer, s String) *int8

CStrCopy copies a Go string to a C string buffer and returns it.

func CStrDup added in v0.4.0

func CStrDup(s String) *int8

func InitNamed added in v0.8.5

func InitNamed(ret *Type, pkgPath, name string, underlying *Type, methods, ptrMethods []Method)

InitNamed initializes an uninitialized named type.

func PrintBool added in v0.8.3

func PrintBool(v bool)

func PrintByte added in v0.8.5

func PrintByte(v byte)

func PrintEface added in v0.8.5

func PrintEface(e Eface)

func PrintFloat added in v0.8.3

func PrintFloat(v float64)

func PrintHex added in v0.8.3

func PrintHex(v uint64)

func PrintIface added in v0.8.3

func PrintIface(i Iface)

func PrintInt added in v0.8.3

func PrintInt(v int64)

func PrintPointer added in v0.8.3

func PrintPointer(p unsafe.Pointer)

func PrintSlice added in v0.8.3

func PrintSlice(s Slice)

func PrintString added in v0.8.3

func PrintString(s String)

func PrintUint added in v0.8.3

func PrintUint(v uint64)

func SliceCopy added in v0.8.5

func SliceCopy(dst Slice, data unsafe.Pointer, num int, etSize int) int

SliceCopy copy data to slice and returns a slice.

func StringEqual added in v0.8.5

func StringEqual(x, y String) bool

func StringIterNext added in v0.8.5

func StringIterNext(it *StringIter) (ok bool, k int, v rune)

func StringLess added in v0.8.5

func StringLess(x, y String) bool

func StringToBytes added in v0.8.5

func StringToBytes(s String) []byte

func StringToRunes added in v0.8.5

func StringToRunes(s string) []rune

func StructField added in v0.8.5

func StructField(name string, typ *Type, off uintptr, tag string, embedded bool) abi.StructField

StructField returns a struct field.

func TracePanic added in v0.4.0

func TracePanic(v Eface)

TracePanic prints panic message.

func Zeroinit added in v0.5.0

func Zeroinit(p c.Pointer, size uintptr) c.Pointer

Zeroinit initializes memory to zero.

Types

type Eface added in v0.8.5

type Eface = eface

func ToEface added in v0.8.5

func ToEface(i Iface) Eface

ToEface converts an iface to an eface.

type FuncType added in v0.8.5

type FuncType = abi.FuncType

func Func added in v0.8.5

func Func(in, out []*Type, variadic bool) *FuncType

Func returns a function type.

type Iface added in v0.8.5

type Iface = iface

type Imethod added in v0.8.5

type Imethod = abi.Imethod

type InterfaceType

type InterfaceType = abi.InterfaceType

func Interface

func Interface(pkgPath, name string, methods []Imethod) *InterfaceType

Interface returns an interface type. Don't call NewNamed for named interface type.

type Itab added in v0.8.5

type Itab = itab

func NewItab added in v0.8.5

func NewItab(inter *InterfaceType, typ *Type) *Itab

NewItab returns a new itab.

type Kind

type Kind = abi.Kind

type Map added in v0.4.0

type Map = hmap

Map represents a Go map.

func MakeSmallMap added in v0.4.0

func MakeSmallMap() *Map

MakeSmallMap creates a new small map.

type Method added in v0.8.5

type Method = abi.Method

type Slice

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

Slice is the runtime representation of a slice.

func NewSlice3 added in v0.5.0

func NewSlice3(base unsafe.Pointer, eltSize, cap, i, j, k int) (s Slice)

func SliceAppend added in v0.8.2

func SliceAppend(src Slice, data unsafe.Pointer, num, etSize int) Slice

SliceAppend append elem data and returns a slice.

type String

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

String is the runtime representation of a string. It cannot be used safely or portably and its representation may change in a later release.

Unlike reflect.StringHeader, its Data field is sufficient to guarantee the data it references will not be garbage collected.

func NewStringSlice added in v0.5.0

func NewStringSlice(base String, i, j int) String

func StringCat added in v0.5.0

func StringCat(a, b String) String

StringCat concatenates two strings.

func StringFromBytes added in v0.8.5

func StringFromBytes(b Slice) (s String)

func StringFromRune added in v0.8.5

func StringFromRune(r rune) (s String)

func StringFromRunes added in v0.8.5

func StringFromRunes(rs []rune) (s String)

type StringIter added in v0.8.5

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

func NewStringIter added in v0.8.5

func NewStringIter(s string) *StringIter

type Type

type Type = abi.Type

func ArrayOf added in v0.8.5

func ArrayOf(length uintptr, elem *Type) *Type

ArrayOf returns the array type with element elem and length.

func Basic

func Basic(kind Kind) *Type

func NewNamed added in v0.8.5

func NewNamed(kind abi.Kind, methods, ptrMethods int) *Type

NewNamed returns an uninitialized named type.

func PointerTo added in v0.8.5

func PointerTo(elem *Type) *Type

PointerTo returns the pointer type with element elem.

func SliceOf added in v0.8.5

func SliceOf(elem *Type) *Type

SliceOf returns the slice type with element elem.

func Struct added in v0.8.5

func Struct(pkgPath string, size uintptr, fields ...abi.StructField) *Type

Struct returns a struct type.

Directories

Path Synopsis
c

Jump to

Keyboard shortcuts

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