runtime

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 3 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 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 CheckI2Float32 added in v0.7.0

func CheckI2Float32(v Interface, t *Type) (float32, bool)

func CheckI2Float64 added in v0.7.0

func CheckI2Float64(v Interface, t *Type) (float64, bool)

func CheckI2Int

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

func I2Float32 added in v0.7.0

func I2Float32(v Interface, t *Type) float32

func I2Float64 added in v0.7.0

func I2Float64(v Interface, t *Type) float64

func I2Int

func I2Int(v Interface, t *Type) uintptr

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 StringData added in v0.4.0

func StringData(s String) unsafe.Pointer

StringData returns the data pointer of a string.

func StringLen added in v0.4.0

func StringLen(s String) int

StringLen returns the length of a string.

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.

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