diff options
author | Ian Lance Taylor <iant@golang.org> | 2009-07-07 15:06:29 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2009-07-07 15:06:29 -0700 |
commit | 2418c15c5681e82be990972cdbc195cb40249e49 (patch) | |
tree | 8dcad21fee18230858200feaae3c03b3b6600219 /src/pkg/unsafe | |
parent | 3d28fc62469d13a745f93c7616c008d317b5b671 (diff) | |
download | golang-2418c15c5681e82be990972cdbc195cb40249e49.tar.gz |
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
Diffstat (limited to 'src/pkg/unsafe')
-rw-r--r-- | src/pkg/unsafe/unsafe.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/pkg/unsafe/unsafe.go b/src/pkg/unsafe/unsafe.go index b19af405b..b2d9a5ab7 100644 --- a/src/pkg/unsafe/unsafe.go +++ b/src/pkg/unsafe/unsafe.go @@ -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. func Alignof(v ArbitraryType) int -// Reflect unpacks an interface value into its internal value word and its type string. -// The boolean indir is true if the value is a pointer to the real value. -func Reflect(i interface {}) (value uint64, typestring string, indir bool) +// Typeof returns the type of an interface value, a runtime.Type. +func Typeof(i interface {}) (typ interface {}) -// Unreflect inverts Reflect: Given a value word, a type string, and the indirect bit, -// it returns an empty interface value with those contents. -func Unreflect(value uint64, typestring string, indir bool) (ret interface {}) +// Reflect unpacks an interface value into its type and the address of a copy of the +// internal value. +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 {}) |