1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:04:52 -07:00

Update the unsafe docs for the new type implementation.

Please correct as needed.

R=rsc,r
DELTA=10  (4 added, 1 deleted, 5 changed)
OCL=31305
CL=31305
This commit is contained in:
Ian Lance Taylor 2009-07-07 15:06:29 -07:00
parent dbc6d91d70
commit 668fa7f677

View File

@ -35,10 +35,13 @@ func Offsetof(v ArbitraryType) int
// If v is of the form obj.f, it returns the alignment of field f within struct object obj. // If v is of the form obj.f, it returns the alignment of field f within struct object obj.
func Alignof(v ArbitraryType) int func Alignof(v ArbitraryType) int
// Reflect unpacks an interface value into its internal value word and its type string. // Typeof returns the type of an interface value, a runtime.Type.
// The boolean indir is true if the value is a pointer to the real value. func Typeof(i interface {}) (typ interface {})
func Reflect(i interface {}) (value uint64, typestring string, indir bool)
// Unreflect inverts Reflect: Given a value word, a type string, and the indirect bit, // Reflect unpacks an interface value into its type and the address of a copy of the
// it returns an empty interface value with those contents. // internal value.
func Unreflect(value uint64, typestring string, indir bool) (ret interface {}) func Reflect(i interface {}) (typ interface {}, addr uintptr)
// Unreflect inverts Reflect: Given a type and a pointer, it returns an empty interface value
// with those contents.
func Unreflect(typ interface {}, addr uintptr) (ret interface {})