Debian Codegraph @

internal/deepequal/type.go

raw
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-go file.
4
5 package deepequal
6
7 import "unsafe"
8
9 // tflag is used by an rtype to signal what extra type information is
10 // available in the memory directly following the rtype value.
11 //
12 // tflag values must be kept in sync with copies in:
13 //
14 // cmd/compile/internal/gc/reflect.go
15 // cmd/link/internal/ld/decodesym.go
16 // runtime/type.go
17 type tflag uint8
18
19 // rtype is the common implementation of most values.
20 // It is embedded in other struct types.
21 //
22 // rtype must be kept in sync with ../runtime/type.go:/^type._type.
23 type rtype struct {
24 size uintptr
25 ptrdata uintptr // number of bytes in the type that can contain pointers
26 hash uint32 // hash of type; avoids computation in hash tables
27 tflag tflag // extra type information flags
28 align uint8 // alignment of variable with this type
29 fieldAlign uint8 // alignment of struct field with this type
30 kind uint8 // enumeration for C
31 // function for comparing objects of this type
32 // (ptr to object A, ptr to object B) -> ==?
33 equal func(unsafe.Pointer, unsafe.Pointer) bool
34 gcdata *byte // garbage collection data
35 str nameOff // string form
36 ptrToThis typeOff // type for pointer to this type, may be zero
37 }
38
39 type nameOff int32 // offset to a name
40
41 type typeOff int32 // offset to an *rtype
42
43 // Pointers reports whether t contains pointers.
44 func (t *rtype) Pointers() bool { return t.ptrdata != 0 }