mirror of
https://github.com/golang/go
synced 2024-11-21 17:54:39 -07:00
unsafe: update doc
changeset: 8812:3fb3e88d5aa8 gc: unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4951051
This commit is contained in:
parent
2cc4a54dec
commit
7c203b8bc1
@ -24,17 +24,17 @@ type Pointer *ArbitraryType
|
|||||||
// Sizeof returns the size in bytes occupied by the value v. The size is that of the
|
// Sizeof returns the size in bytes occupied by the value v. The size is that of the
|
||||||
// "top level" of the value only. For instance, if v is a slice, it returns the size of
|
// "top level" of the value only. For instance, if v is a slice, it returns the size of
|
||||||
// the slice descriptor, not the size of the memory referenced by the slice.
|
// the slice descriptor, not the size of the memory referenced by the slice.
|
||||||
func Sizeof(v ArbitraryType) int
|
func Sizeof(v 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 v,
|
||||||
// which must be of the form struct_value.field. In other words, it returns the
|
// which must be of the form struct_value.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) int
|
func Offsetof(v ArbitraryType) uintptr
|
||||||
|
|
||||||
// Alignof returns the alignment of the value v. It is the maximum value m such
|
// Alignof returns the alignment of the value v. It is the maximum value m such
|
||||||
// that the address of a variable with the type of v will always always be zero mod m.
|
// that the address of a variable with the type of v will always always be zero mod m.
|
||||||
// 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) uintptr
|
||||||
|
|
||||||
// Typeof returns the type of an interface value, a runtime.Type.
|
// Typeof returns the type of an interface value, a runtime.Type.
|
||||||
func Typeof(i interface{}) (typ interface{})
|
func Typeof(i interface{}) (typ interface{})
|
||||||
|
Loading…
Reference in New Issue
Block a user