mirror of https://github.com/golang/go.git
doc: document new reflect.UnsafePointer function
Updates #40592 Change-Id: If66629e47ca9859128ee3ad8fb584e022d7a6982 Reviewed-on: https://go-review.googlesource.com/c/go/+/356255 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
ae4d67c89d
commit
6c200017bf
|
|
@ -175,6 +175,16 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
do fewer allocations.
|
||||
</p>
|
||||
</dd>
|
||||
<dd>
|
||||
<p><!-- CL 350691 -->
|
||||
The new
|
||||
<a href="/pkg/reflect/#Value.UnsafePointer"><code>Value.UnsafePointer</code></a>
|
||||
method returns the Value's value as an <a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code></a>.
|
||||
This allows callers to migrate from <a href="/pkg/reflect/#Value.UnsafeAddr"><code>Value.UnsafeAddr</code></a>
|
||||
and <a href="/pkg/reflect/#Value.Pointer"><code>Value.Pointer</code></a>
|
||||
to eliminate the need to perform uintptr to unsafe.Pointer conversions at the callsite (as unsafe.Pointer rules require).
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- reflect -->
|
||||
|
||||
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
||||
|
|
|
|||
Loading…
Reference in New Issue