Commit 3a523386 authored by Robert Griesemer's avatar Robert Griesemer

unsafe: fix doc strings

Change-Id: I73a416291a2374dbb8ce8586f24059f8dce56529
Reviewed-on: https://go-review.googlesource.com/3360Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
parent 205ae07c
...@@ -24,17 +24,19 @@ type ArbitraryType int ...@@ -24,17 +24,19 @@ type ArbitraryType int
// arbitrary memory. It should be used with extreme care. // arbitrary memory. It should be used with extreme care.
type Pointer *ArbitraryType type Pointer *ArbitraryType
// Sizeof returns the size in bytes occupied by the value v. The size is that of the // Sizeof takes an expression x of any type and returns the size of
// "top level" of the value only. For instance, if v is a slice, it returns the size of // a hypothetical variable v as if v was declared via var v = x.
// the slice descriptor, not the size of the memory referenced by the slice. // Note that the size does not include any memory possibly referenced
func Sizeof(v ArbitraryType) uintptr // by x. For instance, if x is a slice, Sizeof returns the size of the
// slice descriptor, not the size of the memory referenced by the slice.
func Sizeof(x ArbitraryType) uintptr
// Offsetof returns the offset within the struct of the field represented by v, // Offsetof returns the offset within the struct of the field represented by x,
// which must be of the form structValue.field. In other words, it returns the // which must be of the form structValue.field. In other words, it returns the
// number of bytes between the start of the struct and the start of the field. // number of bytes between the start of the struct and the start of the field.
func Offsetof(v ArbitraryType) uintptr func Offsetof(x ArbitraryType) uintptr
// Alignof returns the alignment of the value v. It is the maximum value m such // Alignof takes an expression x of any type and returns the alignment
// that the address of a variable with the type of v will always be zero mod m. // of a hypothetical variable v as if v was declared via var v = x.
// If v is of the form structValue.field, it returns the alignment of field f within struct object obj. // It is the largest value m such that the address of v is zero mod m.
func Alignof(v ArbitraryType) uintptr func Alignof(x ArbitraryType) uintptr
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment