From 98b4f6ac3812b9114740af98447ddde6c8f100a1 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 12 May 2009 21:37:46 -0700 Subject: [PATCH] cleanup of unsafe documentation R=r DELTA=19 (4 added, 7 deleted, 8 changed) OCL=28723 CL=28732 --- doc/go_spec.html | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 3c98df89c6a..de463584f2b 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

Exported identifiers

@@ -4214,13 +4214,14 @@ following interface:
 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 {}
 

@@ -4253,18 +4254,14 @@ alignment of the (type of the) variable in bytes. For a variable

 uintptr(unsafe.Pointer(&x)) % uintptr(unsafe.Alignof(x)) == 0
 
- -

-The maximum alignment is given by the constant Maxalign. -It usually corresponds to the value of Sizeof(x) for -a variable x of the largest numeric type (8 for a -float64), but may -be smaller on systems with weaker alignment restrictions.

Calls to Alignof, Offsetof, and Sizeof are constant expressions of type int.

+

+TODO describe Reflect, Unreflect +

Size and alignment guarantees