Commit 8925290c authored by Keith Randall's avatar Keith Randall
Browse files

reflect: use zero buffer to back the Value returned by Zero

In the common case (<1KB types), no allocation is required
by reflect.Zero.

Also use memclr instead of memmove in Set when the source
is known to be zero.

Fixes #33136

Change-Id: Ic66871930fbb53328032e587153ebd12995ccf55
Reviewed-on: https://go-review.googlesource.com/c/go/+/192331


Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
parent 7e54aa2c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment