diff options
author | Cherry Mui <cherryyz@google.com> | 2023-05-12 15:09:03 -0400 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2023-05-16 21:37:42 +0000 |
commit | 51fe7062d3bdcf3c1fc6de5b8ef8aa689a1d2b73 (patch) | |
tree | 94b9b205ca96906b9f75b79dfbd9ec4603c4449c | |
parent | 7240d7e9e47af734f1b3d3b11769c2bfaa079c1c (diff) | |
download | go-git-51fe7062d3bdcf3c1fc6de5b8ef8aa689a1d2b73.tar.gz |
doc/go1.21: document reflect.Value escape improvements
With CL 408826, CL 413474, etc. reflect.ValueOf no longer
unconditionally escapes its argument, allowing a Value's content
to be allocated on the stack.
Change-Id: I3a0af85c11e2fd0df42b056095565f0ce5548886
Reviewed-on: https://go-review.googlesource.com/c/go/+/494657
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
-rw-r--r-- | doc/go1.21.html | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/go1.21.html b/doc/go1.21.html index 14a2e5fabc..e483e1e556 100644 --- a/doc/go1.21.html +++ b/doc/go1.21.html @@ -105,6 +105,18 @@ Do not send CLs removing the interior tags from such phrases. </dd> </dl> +<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt> + <dd> + <p><!-- CL 408826, CL 413474 --> + In Go 1.21, <a href="/pkg/reflect/#ValueOf"><code>ValueOf</code></a> + no longer forces its argument to be allocated on the heap, allowing + a <code>Value</code>'s content to be allocated on the stack. Most + operations on a <code>Value</code> also allow the underlying value + to be stack allocated. + </p> + </dd> +</dl> + <dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt> <dd> <p><!-- https://go.dev/issue/56102, CL 451356 --> |