Documentation ¶
Index ¶
- Constants
- Variables
- func AllocU(size uintptr) unsafe.Pointer
- func AllocZ(size uintptr) unsafe.Pointer
- func AssertIndexRange(b bool)
- func AssertNegativeShift(b bool)
- func AssertRuntimeError(b bool, msg string)
- func CStrCopy(dest unsafe.Pointer, s String) *int8
- func CStrDup(s String) *int8
- func EfaceEqual(v, u eface) bool
- func IfacePtrData(i iface) unsafe.Pointer
- func IfaceType(i iface) *abi.Type
- func Implements(T, V *abi.Type) bool
- func InitNamed(ret *Type, pkgPath, name string, underlying *Type, ...)
- func New(t *Type) unsafe.Pointer
- func NewArray(t *Type, n int) unsafe.Pointer
- func Panic(v any)
- func PrintBool(v bool)
- func PrintByte(v byte)
- func PrintComplex(v complex128)
- func PrintEface(e Eface)
- func PrintFloat(v float64)
- func PrintHex(v uint64)
- func PrintIface(i Iface)
- func PrintInt(v int64)
- func PrintPointer(p unsafe.Pointer)
- func PrintSlice(s Slice)
- func PrintString(s String)
- func PrintUint(v uint64)
- func Recover() (ret any)
- func Rethrow(link *Defer)
- func SliceCopy(dst Slice, data unsafe.Pointer, num int, etSize int) int
- func StringEqual(x, y String) bool
- func StringIterNext(it *StringIter) (ok bool, k int, v rune)
- func StringLess(x, y String) bool
- func StringToBytes(s String) []byte
- func StringToRunes(s string) []rune
- func StructField(name string, typ *Type, off uintptr, tag string, embedded bool) abi.StructField
- func TracePanic(v any)
- func Typedmemclr(typ *Type, ptr unsafe.Pointer)
- func Typedmemmove(typ *Type, dst, src unsafe.Pointer)
- func Zeroinit(p unsafe.Pointer, size uintptr) unsafe.Pointer
- type Defer
- type Eface
- type FuncType
- type Iface
- type Imethod
- type InterfaceType
- type Itab
- type Kind
- type Map
- type Method
- type Slice
- type String
- func StringCat(a, b String) String
- func StringFrom(data unsafe.Pointer, n int) (s String)
- func StringFromBytes(b Slice) (s String)
- func StringFromCStr(cstr *int8) (s String)
- func StringFromRune(r rune) (s String)
- func StringFromRunes(rs []rune) (s String)
- func StringSlice(base String, i, j int) String
- type StringIter
- type Type
Constants ¶
const MaxZero = 1024
TODO(xsw): check this must match declarations in runtime/map.go.
Variables ¶
var ZeroVal [MaxZero]byte
Functions ¶
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 EfaceEqual ¶ added in v0.8.7
func EfaceEqual(v, u eface) bool
func IfacePtrData ¶ added in v0.8.6
func Implements ¶ added in v0.8.7
Implements reports whether the type V implements the interface type T.
func PrintComplex ¶ added in v0.8.9
func PrintComplex(v complex128)
func PrintEface ¶ added in v0.8.5
func PrintEface(e Eface)
func PrintFloat ¶ added in v0.8.3
func PrintFloat(v float64)
func PrintIface ¶ added in v0.8.3
func PrintIface(i Iface)
func PrintPointer ¶ added in v0.8.3
func PrintSlice ¶ added in v0.8.3
func PrintSlice(s Slice)
func PrintString ¶ added in v0.8.3
func PrintString(s String)
func StringEqual ¶ added in v0.8.5
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 StringToBytes ¶ added in v0.8.5
func StringToRunes ¶ added in v0.8.5
func StructField ¶ added in v0.8.5
StructField returns a struct field.
func Typedmemclr ¶ added in v0.8.9
typedmemclr clears the typed memory at ptr with type typ. The memory at ptr must already be initialized (and hence in type-safe state). If the memory is being initialized for the first time, see memclrNoHeapPointers.
If the caller knows that typ has pointers, it can alternatively call memclrHasPointers.
TODO: A "go:nosplitrec" annotation would be perfect for this.
func Typedmemmove ¶ added in v0.8.9
typedmemmove copies a value of type typ to dst from src. Must be nosplit, see #16026.
TODO: Perfect for go:nosplitrec since we can't have a safe point anywhere in the bulk barrier or memmove.
Types ¶
type Defer ¶ added in v0.8.6
type Defer struct { Addr unsafe.Pointer // sigjmpbuf Bits uintptr Link *Defer Rund unsafe.Pointer // block address after RunDefers }
Defer presents defer statements in a function.
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 Slice ¶
type Slice struct {
// contains filtered or unexported fields
}
Slice is the runtime representation of 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 StringFromBytes ¶ added in v0.8.5
func StringFromCStr ¶ added in v0.8.9
func StringFromRune ¶ added in v0.8.5
func StringFromRunes ¶ added in v0.8.5
func StringSlice ¶ added in v0.8.9
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