mirror of
https://github.com/golang/go
synced 2024-11-02 08:01:26 +00:00
reflect: document ptrdata field of rtype
This CL adds a simple explanation about what means the ptrdata field of the reflect.rtype type. Also document that rtype needs to be kept in sync with the runtime._type type that rtype mirrors. Change-Id: Icd9663a2e4bb94d922a2417cfe4537861d2ccc97 Reviewed-on: https://go-review.googlesource.com/40917 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
bdf746caaa
commit
2ef340f271
1 changed files with 3 additions and 1 deletions
|
@ -289,9 +289,11 @@ const (
|
|||
// It is embedded in other, public struct types, but always
|
||||
// with a unique tag like `reflect:"array"` or `reflect:"ptr"`
|
||||
// so that code cannot convert from, say, *arrayType to *ptrType.
|
||||
//
|
||||
// rtype must be kept in sync with ../runtime/type.go:/^type._type.
|
||||
type rtype struct {
|
||||
size uintptr
|
||||
ptrdata uintptr
|
||||
ptrdata uintptr // number of bytes in the type that can contain pointers
|
||||
hash uint32 // hash of type; avoids computation in hash tables
|
||||
tflag tflag // extra type information flags
|
||||
align uint8 // alignment of variable with this type
|
||||
|
|
Loading…
Reference in a new issue