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 ChanCap(p *Chan) int
- func ChanClose(p *Chan)
- func ChanLen(p *Chan) (n int)
- func ChanRecv(p *Chan, v unsafe.Pointer, eltSize int) (recvOK bool)
- func ChanSend(p *Chan, v unsafe.Pointer, eltSize int) bool
- func ChanTryRecv(p *Chan, v unsafe.Pointer, eltSize int) (recvOK bool, tryOK bool)
- func ChanTrySend(p *Chan, v unsafe.Pointer, eltSize int) bool
- func CreateThread(th *pthread.Thread, attr *pthread.Attr, routine pthread.RoutineFunc, ...) c.Int
- 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 MakeMap(t *maptype, hint int) *hmap
- func MapAccess1(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer
- func MapAccess2(t *maptype, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool)
- func MapAssign(t *maptype, h *Map, key unsafe.Pointer) unsafe.Pointer
- func MapClear(t *maptype, h *hmap)
- func MapDelete(t *maptype, h *hmap, key unsafe.Pointer)
- func MapIterNext(it *hiter) (ok bool, k unsafe.Pointer, v unsafe.Pointer)
- func New(t *Type) unsafe.Pointer
- func NewArray(t *Type, n int) unsafe.Pointer
- func NewMapIter(t *maptype, h *hmap) *hiter
- func Panic(v any)
- func PanicSliceConvert(x int, y int)
- 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 Select(ops ...ChanOp) (isel int, recvOK bool)
- func SetDirectIface(t *abi.Type)
- 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 TrySelect(ops ...ChanOp) (isel int, recvOK, tryOK bool)
- 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 Chan
- type ChanOp
- 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
- func ArrayOf(length uintptr, elem *Type) *Type
- func Basic(_kind Kind) *Type
- func ChanOf(dir int, strChan string, elem *Type) *Type
- func MapOf(key, elem *Type, bucket *Type, flags int) *Type
- func NewNamed(kind abi.Kind, size uintptr, methods, ptrMethods int) *Type
- func PointerTo(elem *Type) *Type
- func SliceOf(elem *Type) *Type
- func Struct(pkgPath string, size uintptr, fields ...abi.StructField) *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 ChanTryRecv ¶ added in v0.8.10
func CreateThread ¶ added in v0.9.7
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 MapAccess1 ¶ added in v0.9.0
func MapAccess2 ¶ added in v0.9.0
func MapIterNext ¶ added in v0.9.0
func NewMapIter ¶ added in v0.9.0
func NewMapIter(t *maptype, h *hmap) *hiter
func PanicSliceConvert ¶ added in v0.9.7
failures in the conversion ([x]T)(s) or (*[x]T)(s), 0 <= x <= y, y == len(s)
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 SetDirectIface ¶ added in v0.8.10
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 Reth unsafe.Pointer // block address after Rethrow 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