From 2ef340f271d0d893ff1dc3cb22dade27db149373 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Tue, 18 Apr 2017 10:48:16 +0200 Subject: [PATCH] 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 --- src/reflect/type.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reflect/type.go b/src/reflect/type.go index c182d8c7da8..13d63489f70 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -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