Skip to content

Commit 6c20001

Browse files
committed
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 <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> Reviewed-by: Keith Randall <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent ae4d67c commit 6c20001

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/go1.18.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
175175
do fewer allocations.
176176
</p>
177177
</dd>
178+
<dd>
179+
<p><!-- CL 350691 -->
180+
The new
181+
<a href="/pkg/reflect/#Value.UnsafePointer"><code>Value.UnsafePointer</code></a>
182+
method returns the Value's value as an <a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code></a>.
183+
This allows callers to migrate from <a href="/pkg/reflect/#Value.UnsafeAddr"><code>Value.UnsafeAddr</code></a>
184+
and <a href="/pkg/reflect/#Value.Pointer"><code>Value.Pointer</code></a>
185+
to eliminate the need to perform uintptr to unsafe.Pointer conversions at the callsite (as unsafe.Pointer rules require).
186+
</p>
187+
</dd>
178188
</dl><!-- reflect -->
179189

180190
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>

0 commit comments

Comments
 (0)