github.com/sitano/gsysint@v0.0.0-20190607084937-69a4f3233e4e/g/type.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Runtime type representation. 6 7 package g 8 9 // tflag is documented in reflect/type.go. 10 // 11 // tflag values must be kept in sync with copies in: 12 // cmd/compile/internal/gc/reflect.go 13 // cmd/link/internal/ld/decodesym.go 14 // reflect/type.go 15 type tflag uint8 16 17 const ( 18 tflagUncommon tflag = 1 << 0 19 tflagExtraStar tflag = 1 << 1 20 tflagNamed tflag = 1 << 2 21 ) 22 23 // Needs to be in sync with ../cmd/link/internal/ld/decodesym.go:/^func.commonsize, 24 // ../cmd/compile/internal/gc/reflect.go:/^func.dcommontype and 25 // ../reflect/type.go:/^type.rtype. 26 type Type struct { 27 size uintptr 28 ptrdata uintptr // size of memory prefix holding all pointers 29 hash uint32 30 tflag tflag 31 align uint8 32 fieldalign uint8 33 kind uint8 34 alg *TypeAlg 35 // gcdata stores the GC type data for the garbage collector. 36 // If the KindGCProg bit is set in kind, gcdata is a GC program. 37 // Otherwise it is a ptrmask bitmap. See mbitmap.go for details. 38 gcdata *byte 39 str nameOff 40 ptrToThis typeOff 41 } 42 43 type nameOff int32 44 type typeOff int32 45 type textOff int32