runtime

package
v0.8.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TyAny = &InterfaceType{}
)

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 CheckI2Int

func CheckI2Int(v Interface, t *Type) (uintptr, bool)

func CheckI2String added in v0.8.0

func CheckI2String(v Interface, t *Type) (string, bool)

func I2Int

func I2Int(v Interface, t *Type) uintptr

func I2String added in v0.8.0

func I2String(v Interface, t *Type) string

func PrintBool added in v0.8.3

func PrintBool(v bool)

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 SliceCap added in v0.5.0

func SliceCap(s Slice) int

SliceCap returns the capacity of a slice.

func SliceData added in v0.4.0

func SliceData(s Slice) unsafe.Pointer

SliceData returns the data pointer of a slice.

func SliceLen added in v0.4.0

func SliceLen(s Slice) int

SliceLen returns the length of a slice.

func TracePanic added in v0.4.0

func TracePanic(v Interface)

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 Interface

type Interface = iface

func MakeAny

func MakeAny(typ *Type, data unsafe.Pointer) Interface

func MakeAnyInt

func MakeAnyInt(typ *Type, data uintptr) Interface

func MakeAnyString

func MakeAnyString(data string) Interface

func MakeInterface

func MakeInterface(inter *InterfaceType, typ *Type, data unsafe.Pointer) Interface

type InterfaceType

type InterfaceType = abi.InterfaceType

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 Slice

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

Slice is the runtime representation of a slice.

func NewSlice added in v0.4.0

func NewSlice(data unsafe.Pointer, len, cap int) Slice

NewSlice creates a new slice.

func NewSlice3 added in v0.5.0

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

func NilSlice

func NilSlice() Slice

NilSlice returns a nil 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 EmptyString

func EmptyString() String

EmptyString returns an empty string.

func NewString added in v0.4.0

func NewString(data unsafe.Pointer, len int) String

NewString creates a new string.

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.

type Type

type Type = abi.Type

func Basic

func Basic(kind Kind) *Type

Directories

Path Synopsis
c

Jump to

Keyboard shortcuts

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