github.com/pkujhd/goloader@v0.0.0-20240411034752-1a28096bd7bd/type.1.8.go (about)

     1  // +build go1.8
     2  // +build !go1.14
     3  
     4  package goloader
     5  
     6  import "unsafe"
     7  
     8  type typeAlg struct {
     9  	// function for hashing objects of this type
    10  	// (ptr to object, seed) -> hash
    11  	hash func(unsafe.Pointer, uintptr) uintptr
    12  	// function for comparing objects of this type
    13  	// (ptr to object A, ptr to object B) -> ==?
    14  	equal func(unsafe.Pointer, unsafe.Pointer) bool
    15  }
    16  
    17  // Needs to be in sync with ../cmd/link/internal/ld/decodesym.go:/^func.commonsize,
    18  // ../cmd/compile/internal/gc/reflect.go:/^func.dcommontype and
    19  // ../reflect/type.go:/^type.rtype.
    20  type _type struct {
    21  	size       uintptr
    22  	ptrdata    uintptr // size of memory prefix holding all pointers
    23  	hash       uint32
    24  	tflag      tflag
    25  	align      uint8
    26  	fieldalign uint8
    27  	kind       uint8
    28  	alg        *typeAlg
    29  	// gcdata stores the GC type data for the garbage collector.
    30  	// If the KindGCProg bit is set in kind, gcdata is a GC program.
    31  	// Otherwise it is a ptrmask bitmap. See mbitmap.go for details.
    32  	gcdata    *byte
    33  	str       nameOff
    34  	ptrToThis typeOff
    35  }