]> Cypherpunks repositories - gostls13.git/commitdiff
doc: document new reflect.UnsafePointer function
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 18 Oct 2021 16:54:02 +0000 (23:54 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 23 Oct 2021 06:31:02 +0000 (06:31 +0000)
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>

doc/go1.18.html

index d95e55e1ad165ee7790bc3c3e4bba5db97b37979..087a06c2805f8b790ebd27a66c878fc9f86abb88 100644 (file)
@@ -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>