mirror of https://github.com/golang/go.git
spec: unsafe.Pointers are pointers
But they cannot be dereferenced. See also issue 6116. Fixes #6358. R=r, rsc, iant, ken CC=golang-dev https://golang.org/cl/14374046
This commit is contained in:
parent
989a63eb0b
commit
e121de2f01
|
|
@ -1,6 +1,6 @@
|
|||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of Oct 3, 2013",
|
||||
"Subtitle": "Version of Oct 7, 2013",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
|
|
@ -5954,6 +5954,8 @@ func Sizeof(variable ArbitraryType) uintptr
|
|||
<p>
|
||||
Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to
|
||||
a <code>Pointer</code> type and vice versa.
|
||||
A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code>
|
||||
value may not be <a href="#Address_operators">dereferenced</a>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
|
|
@ -5962,6 +5964,8 @@ bits = *(*uint64)(unsafe.Pointer(&f))
|
|||
|
||||
type ptr unsafe.Pointer
|
||||
bits = *(*uint64)(ptr(&f))
|
||||
|
||||
var p ptr = nil
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue