diff options
author | Cherry Mui <cherryyz@google.com> | 2023-11-15 21:35:37 -0500 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2023-11-16 19:25:24 +0000 |
commit | 23ca33009571a55eda926b7a41f5ceb04277bbd9 (patch) | |
tree | 5dfc17956bbd2e6b75d0b2b3ea55830039fb4f4c /src/reflect | |
parent | c5e812234c099d6c2749783541830d6272e1af12 (diff) | |
download | go-23ca33009571a55eda926b7a41f5ceb04277bbd9.tar.gz go-23ca33009571a55eda926b7a41f5ceb04277bbd9.zip |
reflect: remove go121noForceValueEscape
Before Go 1.21, ValueOf always escapes and a Value's content is
always heap allocated. In Go 1.21, we made it no longer always
escape, guarded by go121noForceValueEscape. This behavior has
been released for some time and there is no issue so far. We can
remove the guard now.
Change-Id: I81f5366412390f6c63b642f4c7c016da534da76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/542795
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/value.go | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/reflect/value.go b/src/reflect/value.go index 705d74f6b8..5bfdb55fd9 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -3232,25 +3232,12 @@ func Indirect(v Value) Value { return v.Elem() } -// Before Go 1.21, ValueOf always escapes and a Value's content -// is always heap allocated. -// Set go121noForceValueEscape to true to avoid the forced escape, -// allowing Value content to be on the stack. -// Set go121noForceValueEscape to false for the legacy behavior -// (for debugging). -const go121noForceValueEscape = true - // ValueOf returns a new Value initialized to the concrete value // stored in the interface i. ValueOf(nil) returns the zero Value. func ValueOf(i any) Value { if i == nil { return Value{} } - - if !go121noForceValueEscape { - escapes(i) - } - return unpackEface(i) } |