linkname

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 4 Imported by: 0

README

Package linkname exports various private functions from the standard library using the //go:linkname directive.

DON'T USE THIS IF YOU DON'T KNOW WHAT IT IS.

Also, it is a bad practice to use private functions from other packages, and it is UNSAFE and not protected by the Go 1 compatibility promise.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pid

func Pid() int

Pid returns the id of current p.

func Reflect_ifaceIndir

func Reflect_ifaceIndir(unsafe.Pointer) bool

func Reflect_mapiterelem

func Reflect_mapiterelem(it unsafe.Pointer) (elem unsafe.Pointer)

func Reflect_mapiterinit

func Reflect_mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) unsafe.Pointer

func Reflect_mapiterkey

func Reflect_mapiterkey(it unsafe.Pointer) (key unsafe.Pointer)

func Reflect_mapiternext

func Reflect_mapiternext(it unsafe.Pointer)

func Reflect_maplen

func Reflect_maplen(m unsafe.Pointer) int

func Reflect_resolveTypeOff

func Reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer

func Reflect_rtype_Align

func Reflect_rtype_Align(unsafe.Pointer) int

func Reflect_rtype_AssignableTo

func Reflect_rtype_AssignableTo(unsafe.Pointer, reflect.Type) bool

func Reflect_rtype_Bits

func Reflect_rtype_Bits(unsafe.Pointer) int

func Reflect_rtype_ChanDir

func Reflect_rtype_ChanDir(unsafe.Pointer) reflect.ChanDir

func Reflect_rtype_Comparable

func Reflect_rtype_Comparable(unsafe.Pointer) bool

func Reflect_rtype_ConvertibleTo

func Reflect_rtype_ConvertibleTo(unsafe.Pointer, reflect.Type) bool

func Reflect_rtype_Elem

func Reflect_rtype_Elem(unsafe.Pointer) reflect.Type

func Reflect_rtype_Field

func Reflect_rtype_Field(unsafe.Pointer, int) reflect.StructField

func Reflect_rtype_FieldAlign

func Reflect_rtype_FieldAlign(unsafe.Pointer) int

func Reflect_rtype_FieldByIndex

func Reflect_rtype_FieldByIndex(unsafe.Pointer, []int) reflect.StructField

func Reflect_rtype_FieldByName

func Reflect_rtype_FieldByName(unsafe.Pointer, string) (reflect.StructField, bool)

func Reflect_rtype_FieldByNameFunc

func Reflect_rtype_FieldByNameFunc(unsafe.Pointer, func(string) bool) (reflect.StructField, bool)

func Reflect_rtype_Implements

func Reflect_rtype_Implements(unsafe.Pointer, reflect.Type) bool

func Reflect_rtype_In

func Reflect_rtype_In(unsafe.Pointer, int) reflect.Type

func Reflect_rtype_IsVariadic

func Reflect_rtype_IsVariadic(unsafe.Pointer) bool

func Reflect_rtype_Key

func Reflect_rtype_Key(unsafe.Pointer) reflect.Type

func Reflect_rtype_Kind

func Reflect_rtype_Kind(unsafe.Pointer) reflect.Kind

func Reflect_rtype_Len

func Reflect_rtype_Len(unsafe.Pointer) int

func Reflect_rtype_Method

func Reflect_rtype_Method(unsafe.Pointer, int) reflect.Method

func Reflect_rtype_MethodByName

func Reflect_rtype_MethodByName(unsafe.Pointer, string) (reflect.Method, bool)

func Reflect_rtype_Name

func Reflect_rtype_Name(unsafe.Pointer) string

func Reflect_rtype_NumField

func Reflect_rtype_NumField(unsafe.Pointer) int

func Reflect_rtype_NumIn

func Reflect_rtype_NumIn(unsafe.Pointer) int

func Reflect_rtype_NumMethod

func Reflect_rtype_NumMethod(unsafe.Pointer) int

func Reflect_rtype_NumOut

func Reflect_rtype_NumOut(unsafe.Pointer) int

func Reflect_rtype_Out

func Reflect_rtype_Out(unsafe.Pointer, int) reflect.Type

func Reflect_rtype_PkgPath

func Reflect_rtype_PkgPath(unsafe.Pointer) string

func Reflect_rtype_Size

func Reflect_rtype_Size(unsafe.Pointer) uintptr

func Reflect_rtype_String

func Reflect_rtype_String(unsafe.Pointer) string

func Reflect_rtype_ptrTo

func Reflect_rtype_ptrTo(unsafe.Pointer) unsafe.Pointer

func Reflect_toType

func Reflect_toType(unsafe.Pointer) reflect.Type

func Reflect_typedmemmove

func Reflect_typedmemmove(t unsafe.Pointer, dst, src unsafe.Pointer)

Reflect_typedmemmove copies a value of type t to dst from src.

func Reflect_typedslicecopy

func Reflect_typedslicecopy(elemRType unsafe.Pointer, dst, src unsafeheader.Slice) int

Reflect_typedslicecopy copies a slice of elemType values from src to dst, returning the number of elements copied.

func Reflect_typelinks() ([]unsafe.Pointer, [][]int32)

func Reflect_unsafe_New

func Reflect_unsafe_New(unsafe.Pointer) unsafe.Pointer

func Reflect_unsafe_NewArray

func Reflect_unsafe_NewArray(unsafe.Pointer, int) unsafe.Pointer

func Runtime_activeModules

func Runtime_activeModules() []unsafe.Pointer

func Runtime_bytesHash

func Runtime_bytesHash(b []byte, seed uintptr) uintptr

func Runtime_c128hash

func Runtime_c128hash(p unsafe.Pointer, h uintptr) uintptr

func Runtime_c64hash

func Runtime_c64hash(p unsafe.Pointer, h uintptr) uintptr

func Runtime_efaceHash

func Runtime_efaceHash(i any, seed uintptr) uintptr

func Runtime_f32hash

func Runtime_f32hash(p unsafe.Pointer, h uintptr) uintptr

func Runtime_f64hash

func Runtime_f64hash(p unsafe.Pointer, h uintptr) uintptr

func Runtime_fastrand

func Runtime_fastrand() uint32

func Runtime_fastrand64 added in v2.1.0

func Runtime_fastrand64() uint64

func Runtime_fastrandn

func Runtime_fastrandn(n uint32) uint32

func Runtime_int32Hash

func Runtime_int32Hash(i uint32, seed uintptr) uintptr

func Runtime_int64Hash

func Runtime_int64Hash(i uint64, seed uintptr) uintptr

func Runtime_memclrNoHeapPointers

func Runtime_memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)

Runtime_memclrNoHeapPointers clears n bytes starting at ptr.

Usually you should use typedmemclr. Runtime_memclrNoHeapPointers should be used only when the caller knows that *ptr contains no heap pointers because either:

*ptr is initialized memory and its type is pointer-free, or

*ptr is uninitialized memory (e.g., memory that's being reused for a new allocation) and hence contains only "junk".

Runtime_memclrNoHeapPointers ensures that if ptr is pointer-aligned, and n is a multiple of the pointer size, then any pointer-aligned, pointer-sized portion is cleared atomically. Despite the function name, this is necessary because this function is the underlying implementation of typedmemclr and memclrHasPointers. See the doc of memmove for more details.

The (CPU-specific) implementations of this function are in memclr_*.s.

func Runtime_memhash16

func Runtime_memhash16(p unsafe.Pointer, h uintptr) uintptr

func Runtime_memhash8

func Runtime_memhash8(p unsafe.Pointer, h uintptr) uintptr

func Runtime_procPin

func Runtime_procPin() int

Runtime_procPin links to runtime.procPin. It pins current p, return pid.

DON'T USE THIS if you don't know what it is.

func Runtime_procUnpin

func Runtime_procUnpin()

Runtime_procUnpin links to runtime.procUnpin. It unpins current p.

func Runtime_readUnaligned32

func Runtime_readUnaligned32(p unsafe.Pointer) uint32

Runtime_readUnaligned32 reads memory pointed by p as a uint32 value. It performs the read with a native endianness.

It is copied from runtime.readUnaligned32 instead of linked to help inlining.

func Runtime_readUnaligned64

func Runtime_readUnaligned64(p unsafe.Pointer) uint64

Runtime_readUnaligned64 reads memory pointed by p as a uint64 value. It performs the read with a native endianness.

It is copied from runtime.readUnaligned64 but instead of linked to help inlining.

func Runtime_startTheWorld

func Runtime_startTheWorld()

func Runtime_stopTheWorld

func Runtime_stopTheWorld()

Runtime_stopTheWorld links to runtime.stopTheWorld. It stops all P's from executing goroutines, interrupting all goroutines at GC safe points and records reason as the reason for the stop. On return, only the current goroutine's P is running.

func Runtime_stringHash

func Runtime_stringHash(s string, seed uintptr) uintptr

func Runtime_sysAlloc

func Runtime_sysAlloc(n uintptr) []byte

Runtime_sysAlloc allocates memory off heap by calling runtime.sysAllocOS.

DON'T use this if you don't know what it does.

func Runtime_sysFree

func Runtime_sysFree(mem []byte)

Runtime_sysFree frees memory allocated by Runtime_sysAlloc.

DON'T use this if you don't know what it does.

func Runtime_typehash

func Runtime_typehash(rtype unsafe.Pointer, p unsafe.Pointer, h uintptr) uintptr

Types

This section is empty.

Jump to

Keyboard shortcuts

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