diff options
author | Robert Griesemer <gri@golang.org> | 2009-05-12 21:37:46 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-05-12 21:37:46 -0700 |
commit | 15623f8ed536d5519e7774ecc252593d6d0392bb (patch) | |
tree | c516824cc2911beb9c6682b613d0aba30b2d9a85 | |
parent | 1db98d86d282216cf157b9d73951e108743a0a36 (diff) | |
download | golang-15623f8ed536d5519e7774ecc252593d6d0392bb.tar.gz |
cleanup of unsafe documentation
R=r
DELTA=19 (4 added, 7 deleted, 8 changed)
OCL=28723
CL=28732
-rw-r--r-- | doc/go_spec.html | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index 3c98df89c..de463584f 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1306,7 +1306,7 @@ Functions: cap len make new panic panicln print println Packages: - sys (TODO: does sys endure?) + unsafe </pre> <h3>Exported identifiers</h3> @@ -4214,13 +4214,14 @@ following interface: <pre class="grammar"> package unsafe -const Maxalign int +type ArbitraryType int // shorthand for an arbitrary Go type; it is not a real type +type Pointer *ArbitraryType -type Pointer *any // "any" is shorthand for any Go type; it is not a real type. - -func Alignof(variable any) int -func Offsetof(selector any) int -func Sizeof(variable any) int +func Alignof(variable ArbitraryType) int +func Offsetof(selector ArbitraryType) int +func Reflect(i interface {}) (value uint64, typestring string, indir bool) +func Sizeof(variable ArbitraryType) int +func Unreflect(value uint64, typestring string, indir bool) interface {} </pre> <p> @@ -4253,18 +4254,14 @@ alignment of the (type of the) variable in bytes. For a variable <pre> uintptr(unsafe.Pointer(&x)) % uintptr(unsafe.Alignof(x)) == 0 </pre> - -<p> -The maximum alignment is given by the constant <code>Maxalign</code>. -It usually corresponds to the value of <code>Sizeof(x)</code> for -a variable <code>x</code> of the largest numeric type (8 for a -<code>float64</code>), but may -be smaller on systems with weaker alignment restrictions. </p> <p> Calls to <code>Alignof</code>, <code>Offsetof</code>, and <code>Sizeof</code> are constant expressions of type <code>int</code>. </p> +<p> +<font color=red>TODO describe Reflect, Unreflect</font> +</p> <h3>Size and alignment guarantees</h3> |