Source File
type.go
Belonging Package
github.com/goccy/go-json/internal/runtime
package runtimeimport ()type SliceHeader struct {Data unsafe.PointerLen intCap int}const (maxAcceptableTypeAddrRange = 1024 * 1024 * 2 // 2 Mib)type TypeAddr struct {BaseTypeAddr uintptrMaxTypeAddr uintptrAddrRange uintptrAddrShift uintptr}var (typeAddr *TypeAddronce sync.Once)//go:linkname typelinks reflect.typelinksfunc typelinks() ([]unsafe.Pointer, [][]int32)//go:linkname rtypeOff reflect.rtypeOfffunc rtypeOff(unsafe.Pointer, int32) unsafe.Pointerfunc () *TypeAddr {once.Do(func() {, := typelinks()if len() != 1 {return}if len() != 1 {return}:= [0]:= [0]var (uintptr = uintptr(^uint(0))uintptr = 0= true= true)for := 0; < len(); ++ {:= (*Type)(rtypeOff(, [])):= uintptr(unsafe.Pointer())if > {=}if < {=}if .Kind() == reflect.Ptr {= uintptr(unsafe.Pointer(.Elem()))if > {=}if < {=}}= && (-)&63 == 0= && (-)&31 == 0}:= -if == 0 {return}var uintptrif {= 6} else if {= 5}:= >>if > maxAcceptableTypeAddrRange {return}typeAddr = &TypeAddr{BaseTypeAddr: ,MaxTypeAddr: ,AddrRange: ,AddrShift: ,}})return typeAddr}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |